Commit c4416c9a authored by Guillaume Melquiond's avatar Guillaume Melquiond Committed by Andrei Paskevich

Do not set a wallclock time limit if there is no time limit.

parent 2946eca7
...@@ -82,15 +82,17 @@ int main(int argc, char *argv[]) { ...@@ -82,15 +82,17 @@ int main(int argc, char *argv[]) {
if (pid > 0) { if (pid > 0) {
int status; int status;
pid_t p; pid_t p;
struct sigaction sa;
if (timelimit) {
/* set a wallclock time limit as last resort */ /* set a wallclock time limit as last resort */
sa.sa_handler = &wallclock_timelimit_reached; struct sigaction sa;
sigemptyset(&sa.sa_mask); sa.sa_handler = &wallclock_timelimit_reached;
sa.sa_flags = 0; sigemptyset(&sa.sa_mask);
sigaction(SIGALRM, &sa, NULL); sa.sa_flags = 0;
wallclock_timelimit = 2*timelimit + 60; sigaction(SIGALRM, &sa, NULL);
alarm(wallclock_timelimit); wallclock_timelimit = 2*timelimit + 60;
alarm(wallclock_timelimit);
}
/* wait for the subprocess */ /* wait for the subprocess */
p = waitpid(pid, &status, 0); p = waitpid(pid, &status, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment