- wrapper, win: put quotes around program name in command line

svn path=/trunk/boinc_samples/; revision=15438
This commit is contained in:
David Anderson 2008-06-19 22:31:10 +00:00
parent cd912b5a18
commit 493b412c8e
2 changed files with 12 additions and 1 deletions

View File

@ -763,3 +763,11 @@ David 18 June 2008
wrapper/
wrapper.C
David 19 June 2008
- wrapper, Win: put quotes around program name in command-line arg
to CreateProcess() (in case it contains spaces)
- wrapper: close files
wrapper/
wrapper.C

View File

@ -174,6 +174,7 @@ int parse_job_file() {
continue;
}
if (!strcmp(tag, "/job_desc")) {
fclose(f);
return 0;
}
if (!strcmp(tag, "task")) {
@ -184,6 +185,7 @@ int parse_job_file() {
}
}
}
fclose(f);
return ERR_XML_PARSE;
}
@ -274,7 +276,7 @@ int TASK::run(int argct, char** argvt) {
slash_to_backslash(app_path);
memset(&process_info, 0, sizeof(process_info));
memset(&startup_info, 0, sizeof(startup_info));
command = app_path + string(" ") + command_line;
command = string("\"") + app_path + string("\" ") + command_line;
// pass std handles to app
//
@ -501,6 +503,7 @@ void read_checkpoint(int& ntasks, double& cpu) {
FILE* f = fopen(CHECKPOINT_FILENAME, "r");
if (!f) return;
int n = fscanf(f, "%d %lf", &nt, &c);
fclose(f);
if (n != 2) return;
ntasks = nt;
cpu = c;