From 06702f2ed04408962d7e8e6323db97e29dd32669 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 31 Mar 2008 16:40:33 -0700 Subject: fix for bug 2675: correctly detect newly created config nodes. --- src/commit.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/commit.c b/src/commit.c index 980a98b..8fbc1d6 100644 --- a/src/commit.c +++ b/src/commit.c @@ -747,17 +747,16 @@ static boolean commit_delete_child(vtw_def *pdefp, char *child, mark_paths(&mark); if (!deleting) { int status; - /* are we marked with opaque */ push_path(&m_path, child); - push_path(&m_path, opaque_name); + switch_path(APATH); /* switch to active */ status = lstat(m_path.path, &statbuf); + switch_path(CPATH); /* back to changes */ pop_path(&m_path); - pop_path(&m_path); - if (status >= 0) { - /* brand new directory, nothing is - deleted there; - update will handle txn (both begin and end) - */ + if (status < 0) { + /* node doesn't exist in active config. it's newly created + * so we don't need to handle delete. update will handle the + * transaction (if any). + */ return TRUE; } } -- cgit v1.2.3