diff --git a/dcapi/condor/condor_wu.c b/dcapi/condor/condor_wu.c index 5f7f6cb5e8..f94750a2d2 100644 --- a/dcapi/condor/condor_wu.c +++ b/dcapi/condor/condor_wu.c @@ -45,6 +45,8 @@ int wu_check_logical_name(DC_Workunit *wu, const char *logicalFileName) return(DC_ERR_BADPARAM); } } + DC_log(LOG_DEBUG, "Logical filename %s checked OK", + logicalFileName); return(0); } @@ -61,9 +63,10 @@ int wu_gen_condor_submit(DC_Workunit *wu) { FILE *f= NULL; GString *fn; + char *cfgval; if (!wu) - return(-2); + return(DC_ERR_BADPARAM); fn= g_string_new(wu->workdir); fn= g_string_append(fn, "/condor_submit.txt"); @@ -71,9 +74,12 @@ int wu_gen_condor_submit(DC_Workunit *wu) { DC_log(LOG_ERR, "Condor submit file %s creation failed", fn->str); - return(-1); + g_string_free(fn, TRUE); + return(DC_ERR_SYSTEM); } - + g_string_free(fn, TRUE); + + cfgval= DC_getCfgStr(CFG_ARCHITECTURES); fprintf(f, "Executable = %s\n", wu->client_name); fprintf(f, "Universe = vanilla\n"); fprintf(f, "output = internal_output.txt\n"); @@ -84,7 +90,34 @@ int wu_gen_condor_submit(DC_Workunit *wu) if (f) fclose(f); - return(0); + return(DC_OK); +} + + +int wu_make_client_executables(DC_Workunit *wu) +{ + char *archs; + int ret; + GString *src, *dst; + + if (!wu) + return(DC_ERR_BADPARAM); + + archs= DC_getCfgStr(CFG_ARCHITECTURES); + + src= g_string_new(wu->client_name); + dst= g_string_new(wu->workdir); + g_string_append(dst, "/"); + g_string_append(dst, wu->client_name); + DC_log(LOG_DEBUG, "Copying client executable %s to %s", + src->str, dst->str); + ret= _DC_copyFile(src->str, dst->str); + g_string_free(src, TRUE); + g_string_free(dst, TRUE); + if (!ret) + return(ret); + + return(DC_OK); }