X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fprogram.cpp;h=00a28e9fee79cac2cca8a28e390328aedfde99e6;hp=5ea1591611a6dbab3f631a3018c978a4e4c4ef1c;hb=refs%2Fheads%2Fmaster;hpb=7c42b4b7e5ed6e423f0c023ad6e8a2aa47a4f081 diff --git a/judge/manager/program.cpp b/judge/manager/program.cpp index 5ea1591..00a28e9 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); @@ -249,6 +251,7 @@ bool Program::GetMessage(string & buffer, double timeout) buffer += c; } //fprintf(stderr, "%s\n", buffer.c_str()); + //fprintf(stderr,"DONE\n"); return true; /* Old way, using threads, which apparently is terrible