X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fprogram.cpp;h=c936de38d42cc23830d838d770b9da0a7388bb81;hp=5ea1591611a6dbab3f631a3018c978a4e4c4ef1c;hb=ac335e7c423d067effae82cc80db518f896271b9;hpb=7c42b4b7e5ed6e423f0c023ad6e8a2aa47a4f081 diff --git a/judge/manager/program.cpp b/judge/manager/program.cpp index 5ea1591..c936de3 100644 --- a/judge/manager/program.cpp +++ b/judge/manager/program.cpp @@ -32,7 +32,7 @@ Program::Program(const char * executablePath) : input(NULL), output(NULL), pid(0 { - + /* vector args; if (executablePath[0] != '"') args.push_back((char*)executablePath); @@ -70,6 +70,7 @@ Program::Program(const char * executablePath) : input(NULL), output(NULL), pid(0 for (unsigned int i=0; i < args.size(); ++i) arguments[i] = args[i]; } + */ //See if file exists and is executable... if (access(executablePath, X_OK) != 0) { @@ -100,7 +101,8 @@ Program::Program(const char * executablePath) : input(NULL), output(NULL), pid(0 if (access(executablePath, X_OK) == 0) //Check we STILL have permissions to start the file { - execv(executablePath,arguments); ///Replace process with desired executable + execl(executablePath, executablePath, (char*)(NULL)); ///Replace process with desired executable + //execv(executablePath,arguments); ///Replace process with desired executable } perror("execv error:\n"); fprintf(stderr, "Program::Program - Could not run program \"%s\"!\n", executablePath);