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:
Dan Williams 2011-04-14 16:48:30 -05:00
parent f7428864ae
commit 688da0fe4f

View file

@ -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;