From 30396cfbbb82538b784f6942bbcd5895e7251e5b Mon Sep 17 00:00:00 2001 From: drdani Date: Thu, 8 Jun 2006 09:11:57 +0000 Subject: [PATCH] move argc member of wu structure into the "static" part git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@657 a7169a2c-3604-0410-bc95-c702d8d87f7a --- dcapi/condor/condor_defs.h | 2 +- dcapi/condor/condor_master.c | 8 +++++--- dcapi/condor/condor_wu.c | 12 ++++++++++++ dcapi/condor/condor_wu.h | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dcapi/condor/condor_defs.h b/dcapi/condor/condor_defs.h index 99fa2d203a..971028017a 100644 --- a/dcapi/condor/condor_defs.h +++ b/dcapi/condor/condor_defs.h @@ -30,6 +30,7 @@ struct _DC_condor_event struct _DC_wu_data { char *client_name; + int argc; }; struct _DC_Workunit @@ -38,7 +39,6 @@ struct _DC_Workunit int chk; struct _DC_wu_data data; char **argv; - int argc; char *tag; int subresults; diff --git a/dcapi/condor/condor_master.c b/dcapi/condor/condor_master.c index 514247a9d5..57d418c65d 100644 --- a/dcapi/condor/condor_master.c +++ b/dcapi/condor/condor_master.c @@ -73,7 +73,7 @@ DC_initMaster(const char *configFile) /* Enforce a canonical string representation of the UUID */ uuid_unparse_lower(_DC_project_uuid, _DC_project_uuid_str); - return(0); + return(DC_OK); } @@ -96,7 +96,9 @@ DC_createWU(const char *clientName, _DC_wu_set_client_name(wu, clientName); wu->argv= g_strdupv((char **) arguments); - for (wu->argc= 0; arguments && arguments[wu->argc]; wu->argc++) + for (_DC_wu_set_argc(wu, 0); + arguments && arguments[wu->data.argc]; + _DC_wu_set_argc(wu, wu->data.argc+1)) ; wu->subresults= subresults; wu->tag= g_strdup(tag); @@ -135,7 +137,7 @@ DC_createWU(const char *clientName, "Failed to create WU working directory %s: %s", str->str, strerror(errno)); DC_destroyWU(wu); - return NULL; + return(NULL); } wu->workdir= str->str; diff --git a/dcapi/condor/condor_wu.c b/dcapi/condor/condor_wu.c index 4b97459400..b47c362853 100644 --- a/dcapi/condor/condor_wu.c +++ b/dcapi/condor/condor_wu.c @@ -39,6 +39,7 @@ _DC_wu_check(const DC_Workunit *wu) return(TRUE); } + int _DC_wu_set_client_name(DC_Workunit *wu, const char *new_name) @@ -51,6 +52,17 @@ _DC_wu_set_client_name(DC_Workunit *wu, return(DC_OK); } +int +_DC_wu_set_argc(DC_Workunit *wu, + int new_argc) +{ + if (!_DC_wu_check(wu)) + return(DC_ERR_UNKNOWN_WU); + wu->data.argc= new_argc; + _DC_wu_changed(wu); + return(DC_OK); +} + /* Check if the logical name is not already registered */ int diff --git a/dcapi/condor/condor_wu.h b/dcapi/condor/condor_wu.h index d3e3710e5c..ce22b18a7a 100644 --- a/dcapi/condor/condor_wu.h +++ b/dcapi/condor/condor_wu.h @@ -16,6 +16,8 @@ extern void _DC_wu_changed(DC_Workunit *wu); extern int _DC_wu_check(const DC_Workunit *wu); extern int _DC_wu_set_client_name(DC_Workunit *wu, const char *new_name); +extern int _DC_wu_set_argc(DC_Workunit *wu, + int new_argc); extern int _DC_wu_check_logical_name(DC_Workunit *wu, const char *logicalFileName); extern char *_DC_wu_get_workdir_path(DC_Workunit *wu,