Skip to content

Commit 539e775

Browse files
committed
Fix unused write() return value warning
1 parent 6cf9fc4 commit 539e775

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/server.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ static void onTerminate(int status) {
143143
static void onIllegal(int status) {
144144
const char msg[] = "SIGILL received: illegal instruction, unsupported CPU or device. Terminating.\n";
145145
#ifdef __linux__
146-
write(STDERR_FILENO, msg, sizeof(msg) - 1);
146+
ssize_t ret __attribute__((unused)) = write(STDERR_FILENO, msg, sizeof(msg) - 1);
147147
#elif _WIN32
148-
_write(_fileno(stderr), msg, sizeof(msg) - 1);
148+
int ret = _write(_fileno(stderr), msg, sizeof(msg) - 1);
149+
(void)ret;
149150
#endif
150151
// Exit code 128+N is the standard shell convention for signal-terminated
151152
// processes (bash, dash, Docker, Kubernetes all follow this).

0 commit comments

Comments
 (0)