Skip to content

Commit 812042e

Browse files
author
Michael Vasseur
committed
Check returncode as FIXME.
1 parent 9362b92 commit 812042e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

judge/judgedaemon.main.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ function fetch_executable_internal(
334334
$execrunpath = $execbuilddir . '/run';
335335
$execrunjurypath = $execbuilddir . '/runjury';
336336
if (!is_dir($execdir) || !file_exists($execdeploypath)) {
337-
system('rm -rf ' . dj_escapeshellarg($execdir) . ' ' . dj_escapeshellarg($execbuilddir));
337+
system('rm -rf ' . dj_escapeshellarg($execdir) . ' ' . dj_escapeshellarg($execbuilddir), $retval);
338+
if ($retval !== 0) {
339+
logmsg(LOG_WARNING, "Deleting '$execdir' or '$execbuilddir' was unsuccessful.");
340+
}
338341
system('mkdir -p ' . dj_escapeshellarg($execbuilddir), $retval);
339342
if ($retval !== 0) {
340343
error("Could not create directory '$execbuilddir'");
@@ -844,7 +847,9 @@ function fetch_executable_internal(
844847
$debug_cmd = implode(' ', array_map('dj_escapeshellarg',
845848
[$runpath, $workdir, $tmpfile]));
846849
system($debug_cmd, $retval);
847-
// FIXME: check retval
850+
if ($retval !== 0) {
851+
error("Running '$runpath' failed.");
852+
}
848853

849854
request(
850855
sprintf('judgehosts/add-debug-info/%s/%s', urlencode($myhost),
@@ -897,7 +902,9 @@ function fetch_executable_internal(
897902
$visual_cmd = implode(' ', array_map('dj_escapeshellarg',
898903
[$runpath, $teamoutput, $tmpfile]));
899904
system($visual_cmd, $retval);
900-
// FIXME: check retval
905+
if ($retval !== 0) {
906+
error("Running '$runpath' failed.");
907+
}
901908

902909
request(
903910
sprintf('judgehosts/add-visual/%s/%s', urlencode($myhost),

0 commit comments

Comments
 (0)