From 989e18d1c463dae8f7777532f57fcbd5bc386b62 Mon Sep 17 00:00:00 2001 From: slioch Date: Mon, 6 Jul 2009 17:31:50 -0700 Subject: fix for ptr magic on 64 bit system. looks like double ptr was getting the missing the last 4 bytes on 64 bit copy. --- src/commit2.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/commit2.c b/src/commit2.c index 5f70aa4..a324bab 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -943,7 +943,7 @@ validate_configuration(GNode *root_node, boolean mode, GSList **nodes_visited_co struct Result result; result._err_code = 0; result._mode = (int)mode; - result._data = (void*)nodes_visited_coll; + result._data = (void*)*nodes_visited_coll; //handles both syntax and commit result._action = syntax_act; @@ -963,7 +963,7 @@ validate_configuration(GNode *root_node, boolean mode, GSList **nodes_visited_co } GList **c_tmp = (GList**)result._data; - *nodes_visited_coll = (GSList*)*c_tmp; + *nodes_visited_coll = (GSList*)c_tmp; return TRUE; } @@ -985,8 +985,7 @@ validate_func(GNode *node, gpointer data) struct Result *result = (struct Result*)data; //since this visits all working nodes, let's maintain a set of nodes to commit - GList **c_tmp = (GList**)result->_data; - GList *coll = *c_tmp; + GList *coll = (GList*)result->_data; if (d->_path != NULL) { char *buf = malloc(MAX_LENGTH_DIR_PATH*sizeof(char)); if (IS_DELETE(d->_operation)) { @@ -996,7 +995,7 @@ validate_func(GNode *node, gpointer data) strcat(buf,val); } coll = g_slist_append(coll,buf); - result->_data = (void*)&coll; + result->_data = (void*)coll; } else if (IS_SET_OR_CREATE(d->_operation)) { sprintf(buf,"+ %s",d->_path); @@ -1005,7 +1004,7 @@ validate_func(GNode *node, gpointer data) strcat(buf,val); } coll = g_slist_append(coll,buf); - result->_data = (void*)&coll; + result->_data = (void*)coll; } } -- cgit v1.2.3 From 82751643f22509c145d7dae31798913ffc4c7f41 Mon Sep 17 00:00:00 2001 From: slioch Date: Tue, 14 Jul 2009 10:56:02 -0700 Subject: fix for bug 4255. commit check was not being called on active node that had deleted children. This change only affects the commit check for nodes that are transactions and are not directly deleted, but have deleted children. commit check is now being called. --- src/commit2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/commit2.c b/src/commit2.c index a324bab..d489923 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -1008,7 +1008,7 @@ validate_func(GNode *node, gpointer data) } } - if (IS_DELETE(d->_operation)) { + if (IS_DELETE(d->_operation) && !IS_ACTIVE(d->_operation)) { return FALSE; //will not perform validation checks on deleted nodes } -- cgit v1.2.3 From f50e8a9c76156a003d07fbca48f35abd24a434d0 Mon Sep 17 00:00:00 2001 From: slioch Date: Fri, 4 Sep 2009 21:17:23 -0700 Subject: added data path to environment during commit. value key is "NODE_DATA_PATH". nodes are delimited by "/" rather than spaces. --- src/commit2.c | 7 +++++++ src/common/defs.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/commit2.c b/src/commit2.c index d489923..6274ec6 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -409,6 +409,9 @@ process_func(GNode *node, gpointer data) set_in_delete_action(TRUE); } + //set location env + setenv(ENV_DATA_PATH,d->_path,1); + //do last sibling check GNode *n = g_node_last_sibling(node); if (n == node) { @@ -451,6 +454,7 @@ process_func(GNode *node, gpointer data) unsetenv(ENV_ACTION_NAME); unsetenv(ENV_SIBLING_POSITION); + unsetenv(ENV_DATA_PATH); if (g_coverage) { struct timeval t; @@ -1062,7 +1066,10 @@ validate_func(GNode *node, gpointer data) boolean status = 1; if (g_dump_actions == FALSE) { + //set location env + setenv(ENV_DATA_PATH,d->_path,1); status = execute_list(c->_def.actions[result->_action].vtw_list_head,&c->_def); + unsetenv(ENV_DATA_PATH); } else { char buf[MAX_LENGTH_DIR_PATH*sizeof(char)]; diff --git a/src/common/defs.h b/src/common/defs.h index daca88a..50d2337 100644 --- a/src/common/defs.h +++ b/src/common/defs.h @@ -16,7 +16,7 @@ #define ENV_ACTION_SET "SET" #define ENV_ACTION_ACTIVE "ACTIVE" #define ENV_SIBLING_POSITION "COMMIT_SIBLING_POSITION" - +#define ENV_DATA_PATH "NODE_DATA_PATH" struct Result { -- cgit v1.2.3