mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 17:00:29 +01:00
core: better fix for ignoring return value of write(2)
Casting to (void) still doesn't do it, so just assign it to something and ignore it, in conjunction with -Wno-unused-but-set-variable
This commit is contained in:
parent
f7428864ae
commit
688da0fe4f
1 changed files with 3 additions and 3 deletions
|
|
@ -146,7 +146,7 @@ static gboolean quit_early = FALSE;
|
|||
static void
|
||||
nm_signal_handler (int signo)
|
||||
{
|
||||
static int in_fatal = 0;
|
||||
static int in_fatal = 0, x;
|
||||
|
||||
/* avoid loops */
|
||||
if (in_fatal > 0)
|
||||
|
|
@ -168,7 +168,7 @@ nm_signal_handler (int signo)
|
|||
--in_fatal;
|
||||
nm_log_warn (LOGD_CORE, "caught signal %d, shutting down abnormally. Generating backtrace...", signo);
|
||||
nm_logging_backtrace ();
|
||||
(void) write (quit_pipe[1], "X", 1);
|
||||
x = write (quit_pipe[1], "X", 1);
|
||||
break;
|
||||
case SIGINT:
|
||||
case SIGTERM:
|
||||
|
|
@ -176,7 +176,7 @@ nm_signal_handler (int signo)
|
|||
--in_fatal;
|
||||
nm_log_info (LOGD_CORE, "caught signal %d, shutting down normally.", signo);
|
||||
quit_early = TRUE;
|
||||
(void) write (quit_pipe[1], "X", 1);
|
||||
x = write (quit_pipe[1], "X", 1);
|
||||
break;
|
||||
case SIGHUP:
|
||||
--in_fatal;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue