Skip to content

Commit

Permalink
Check fork failed
Browse files Browse the repository at this point in the history
  • Loading branch information
quark-zju committed Nov 9, 2014
1 parent c3e14a2 commit 9133424
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ljudge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,11 @@ static LrunResult lrun(
#endif

pid_t pid = fork();
if (pid == -1) {
log_debug("failed to fork\n");
result.error = "cannot fork to run lrun";
return result;
}
if (pid) {
close(pipe_fd[1]);

Expand Down

0 comments on commit 9133424

Please sign in to comment.