Skip to content

Explicit handle ignoring the return code for failed error messages #3045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions judge/runguard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include <sys/sysinfo.h>
#include <vector>
#include <string>
#include <utility>

#define PROGRAM "runguard"
#define VERSION DOMJUDGE_VERSION "/" REVISION
Expand Down Expand Up @@ -233,7 +234,7 @@ void verbose(const char *format, ...)
void verbose_from_signalhandler(const char* msg)
{
if (!be_quiet && be_verbose) {
write(STDERR_FILENO, msg, strlen(msg));
[[maybe_unused]] auto r = write(STDERR_FILENO, msg, strlen(msg));
}
}

Expand All @@ -242,7 +243,7 @@ void warning_from_signalhandler(const char* msg)
if (!be_quiet) {
// Do not include timing here, as it wouldn't be safe from a signalhandler.
// TODO: Consider rewriting using clock_gettime in the future.
write(STDERR_FILENO, msg, strlen(msg));
[[maybe_unused]] auto r = write(STDERR_FILENO, msg, strlen(msg));
}
}

Expand Down
Loading