Commit b8997b1a authored by Guillaume Melquiond's avatar Guillaume Melquiond

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

parent ca7e7cd7
......@@ -82,15 +82,17 @@ int main(int argc, char *argv[]) {
if (pid > 0) {
int status;
pid_t p;
struct sigaction sa;
/* set a wallclock time limit as last resort */
sa.sa_handler = &wallclock_timelimit_reached;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGALRM, &sa, NULL);
wallclock_timelimit = 2*timelimit + 60;
alarm(wallclock_timelimit);
if (timelimit) {
/* set a wallclock time limit as last resort */
struct sigaction sa;
sa.sa_handler = &wallclock_timelimit_reached;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGALRM, &sa, NULL);
wallclock_timelimit = 2*timelimit + 60;
alarm(wallclock_timelimit);
}
/* wait for the subprocess */
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