Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions judge/judgedaemon.main.php
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ private function readJudgehostLog(int $numLines = 20): string
return trim(ob_get_clean());
}

private function runCommandSafe(array $command_parts, & $retval = DONT_CARE, $log_nonzero_exitcode = true): bool
private function runCommandSafe(array $command_parts, &$retval = DONT_CARE, $log_nonzero_exitcode = true): bool
{
if (empty($command_parts)) {
logmsg(LOG_WARNING, "Need at least the command that should be called.");
Expand All @@ -869,7 +869,7 @@ private function runCommandSafe(array $command_parts, & $retval = DONT_CARE, $lo

logmsg(LOG_DEBUG, "Executing command: $command");
system($command, $retval_local);
if ($retval !== DONT_CARE) $retval = $retval_local;
if ($retval !== DONT_CARE) $retval = $retval_local; // phpcs:ignore Generic.ControlStructures.InlineControlStructure.NotAllowed

if ($retval_local !== 0) {
if ($log_nonzero_exitcode) {
Expand All @@ -888,8 +888,7 @@ private function fetchExecutable(
string $hash,
int $judgeTaskId,
bool $combined_run_compare = false
): array
{
): array {
[$execrunpath, $error, $buildlogpath] = $this->fetchExecutableInternal($workdirpath, $type, $execid, $hash, $combined_run_compare);
if (isset($error)) {
$extra_log = null;
Expand Down Expand Up @@ -917,8 +916,7 @@ private function fetchExecutableInternal(
string $execid,
string $hash,
bool $combined_run_compare = false
): array
{
): array {
$execdir = join('/', [
$workdirpath,
'executable',
Expand Down Expand Up @@ -1123,12 +1121,11 @@ private function registerJudgehost(): void
private function disable(
string $kind,
string $idcolumn,
$id,
mixed $id,
string $description,
?int $judgeTaskId = null,
?string $extra_log = null
): void
{
): void {
$disabled = dj_json_encode(['kind' => $kind, $idcolumn => $id]);
$judgehostlog = $this->readJudgehostLog();
if (isset($extra_log)) {
Expand Down Expand Up @@ -1197,8 +1194,7 @@ private function compile(
array $compile_config,
?string $daemonid,
int $output_storage_limit
): bool
{
): bool {
// Reuse compilation if it already exists.
if (file_exists("$workdir/compile.success")) {
return true;
Expand Down
Loading