summaryrefslogtreecommitdiff
path: root/src/commit2.c
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-06-05 16:09:58 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-06-05 16:15:45 -0700
commitcdebe1dc14fb277765f6102956a5e57e840c18f7 (patch)
treee8494ceddbdf1f1df5e948e22080160062f74d83 /src/commit2.c
parent437bd97cf63eeebaa5017785ad55facd5c23d95b (diff)
downloadvyatta-cfg-cdebe1dc14fb277765f6102956a5e57e840c18f7.tar.gz
vyatta-cfg-cdebe1dc14fb277765f6102956a5e57e840c18f7.zip
fix for bug 4444.
Post unionfs directory magic until after all actions have been applied to node tree.
Diffstat (limited to 'src/commit2.c')
-rw-r--r--src/commit2.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/commit2.c b/src/commit2.c
index 6229221..fa03314 100644
--- a/src/commit2.c
+++ b/src/commit2.c
@@ -42,7 +42,7 @@ GNode*
get_transactions(GNode*, boolean priority);
boolean
-complete(GNode *node, boolean test_mode);
+complete(GSList *node_coll, boolean test_mode);
gboolean
sort_func(GNode *node, gpointer data, boolean priority_mode);
@@ -194,6 +194,7 @@ main(int argc, char** argv)
exit(0);
}
+ GSList *completed_root_node_coll = NULL;
boolean no_errors = TRUE;
set_in_commit(TRUE);
int i = 0;
@@ -226,7 +227,8 @@ main(int argc, char** argv)
}
else {
if (disable_partial_commit == FALSE && g_dump_actions == FALSE) {
- complete(comp_cp_node, test_mode);
+ // complete(comp_cp_node, test_mode);
+ completed_root_node_coll = g_slist_append(completed_root_node_coll,comp_cp_node);
}
}
}
@@ -247,12 +249,13 @@ main(int argc, char** argv)
if (no_errors == TRUE) {
if (disable_partial_commit == TRUE && g_dump_actions == FALSE) {
- complete(orig_node_tree, test_mode);
+ completed_root_node_coll = g_slist_append(completed_root_node_coll,orig_node_tree);
}
/*
* Need to add to the following func below to clean up dangling .wh. files
*/
if (g_dump_actions == FALSE) {
+ complete(completed_root_node_coll, test_mode);
common_commit_clean_temp_config(orig_node_tree, test_mode);
}
if (g_debug == TRUE) {
@@ -262,6 +265,7 @@ main(int argc, char** argv)
}
else {
fprintf(out_stream,"Commit failed\n");
+ complete(completed_root_node_coll, test_mode);
}
set_in_commit(FALSE);
@@ -448,21 +452,24 @@ process_func(GNode *node, gpointer data)
*
**/
boolean
-complete(GNode *node, boolean test_mode)
+complete(GSList *node_coll, boolean test_mode)
{
- gpointer gp = ((GNode*)node)->data;
- if (g_debug) {
- if (((struct VyattaNode*)gp)->_data._name != NULL) {
- printf("commit2::complete():name: %s, path: %s\n",((struct VyattaNode*)gp)->_data._name,((struct VyattaNode*)gp)->_data._path);
- syslog(LOG_DEBUG,"commit2::complete():name: %s, path: %s",((struct VyattaNode*)gp)->_data._name,((struct VyattaNode*)gp)->_data._path);
- }
- else {
- printf("commit2::complete()\n");
- syslog(LOG_DEBUG,"commit2::complete()");
+ GSList *l;
+ for (l = node_coll; l; l = g_slist_next (l)) {
+ gpointer gp = ((GNode*)l->data)->data;
+ if (g_debug) {
+ if (((struct VyattaNode*)gp)->_data._name != NULL) {
+ printf("commit2::complete():name: %s, path: %s\n",((struct VyattaNode*)gp)->_data._name,((struct VyattaNode*)gp)->_data._path);
+ syslog(LOG_DEBUG,"commit2::complete():name: %s, path: %s",((struct VyattaNode*)gp)->_data._name,((struct VyattaNode*)gp)->_data._path);
+ }
+ else {
+ printf("commit2::complete()\n");
+ syslog(LOG_DEBUG,"commit2::complete()");
+ }
}
+ //on transactional nodes only, note to avoid calling this if a headless root
+ common_commit_copy_to_live_config(l->data, test_mode);
}
- //on transactional nodes only, note to avoid calling this if a headless root
- common_commit_copy_to_live_config(node, test_mode);
return TRUE;
}