summaryrefslogtreecommitdiff
path: root/src/commit2.c
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-02-24 13:08:52 -0800
committerslioch <slioch@eng-140.vyatta.com>2009-02-24 13:08:52 -0800
commit91a4c9f9093a5ef5d0baf792dd94a3f4e15d4488 (patch)
treea25f47f1ccd5391e8e343a1135429365f0f6b726 /src/commit2.c
parentb7098025c671a543f37cc3156194bdef8a0ad5c6 (diff)
downloadvyatta-cfg-91a4c9f9093a5ef5d0baf792dd94a3f4e15d4488.tar.gz
vyatta-cfg-91a4c9f9093a5ef5d0baf792dd94a3f4e15d4488.zip
replace unionfs synchronization code with piecewise copy. this should fix most of the problems related to nested priorities (but not all). also moved node profiling output from debug file
to stdout (when enabled by the -c flag).
Diffstat (limited to 'src/commit2.c')
-rw-r--r--src/commit2.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/commit2.c b/src/commit2.c
index 82045fc..6d358c5 100644
--- a/src/commit2.c
+++ b/src/commit2.c
@@ -202,7 +202,10 @@ main(int argc, char** argv)
printf("commit2: Starting new transaction processing pass on root:\n");
}
}
-
+
+ //complete() now requires a undisturbed copy of the trans_child_node tree
+ GNode *comp_cp_node = g_node_copy(trans_child_node);
+
//on each priority node now execute actions
if ((success = process_priority_node(trans_child_node)) == TRUE) {
//this below copies the node directory from the local to active location
@@ -211,7 +214,7 @@ main(int argc, char** argv)
//no op, need better way to define true root
}
else {
- complete(trans_child_node, test_mode);
+ complete(comp_cp_node, test_mode);
}
}
@@ -321,7 +324,7 @@ process_func(GNode *node, gpointer data)
if (g_coverage) {
struct timeval t;
gettimeofday(&t,NULL);
- printf("[START] %lu, %s@%s",(unsigned long)t.tv_sec,ActionNames[result->_action],d->_path);
+ fprintf(out_stream,"[START] %lu, %s@%s",(unsigned long)t.tv_sec,ActionNames[result->_action],d->_path);
}
if (result->_action == delete_act) {
@@ -335,7 +338,7 @@ process_func(GNode *node, gpointer data)
if (g_coverage) {
struct timeval t;
gettimeofday(&t,NULL);
- printf("[END] %lu\n",t.tv_sec);
+ fprintf(out_stream,"[END] %lu\n",t.tv_sec);
}
if (!status) { //EXECUTE_LIST RETURNS FALSE ON FAILURE....
@@ -363,14 +366,15 @@ complete(GNode *node, boolean test_mode)
gpointer gp = ((GNode*)node)->data;
if (g_debug) {
if (((struct VyattaNode*)gp)->_data._name != NULL) {
- printf("commit2::complete(): %s\n",((struct VyattaNode*)gp)->_data._name);
+ printf("commit2::complete():name: %s\n",((struct VyattaNode*)gp)->_data._name);
+ printf("commit2::complete():path: %s\n",((struct VyattaNode*)gp)->_data._path);
}
else {
printf("commit2::complete()\n");
}
}
//on transactional nodes only, note to avoid calling this if a headless root
- common_commit_copy_to_live_config(((struct VyattaNode*)gp)->_data._path, test_mode);
+ common_commit_copy_to_live_config(node, test_mode);
return TRUE;
}