Skip to content

Commit

Permalink
nonblocking to avoid block on all pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
meisterT committed Nov 30, 2023
1 parent 170f0ec commit 4174e56
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion judge/judgedaemon.main.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ function fetch_executable_internal(
$buildscript .= "gcc -Wall -O2 -std=gnu11 $source -o run -lm\n";
break;
case 'cpp':
$buildscript .= "g++ -Wall -O2 -std=gnu++17 $source -o run\n";
$buildscript .= "g++ -Wall -g -O2 -std=gnu++17 $source -o run\n";
break;
case 'java':
$buildscript .= "javac -cp . -d . $source\n";
Expand Down
1 change: 1 addition & 0 deletions judge/runguard.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ int main(int argc, char **argv)
}

/* Return the exitstatus of the command */
verbose("WE ARE ABORTING OUR MISSION: %d", exitcode);
return exitcode;
}

Expand Down
1 change: 1 addition & 0 deletions judge/runpipe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ struct state_t {
write_end, j, read_end);
other.proxy_to_process = write_end;
other.stdin_fd = read_end;
set_non_blocking(other.proxy_to_process);
} else {
// No proxy: direct communication.
tie(read_end, write_end) = make_pipe();
Expand Down

0 comments on commit 4174e56

Please sign in to comment.