]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
signal_handler: avoid signed/unsigned mismatch (-Wsign-compare)
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 4 Mar 2015 11:52:51 +0000 (11:52 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 4 Mar 2015 18:41:15 +0000 (18:41 +0000)
We're ignoring the result of this write() to stderr anyway, because
if it failed... what would we do? Write to stderr? That wouldn't work
any better the second time :-)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
bus/main.c

index b48f03f3d5d58267b9c1f3301c1d82b736d71bc6..ad02b97ecc362a35ad3df60a6fa952c38e7f0b35 100644 (file)
@@ -87,7 +87,8 @@ signal_handler (int sig)
             static const char message[] =
               "Unable to write to reload pipe - buffer full?\n";
 
-            if (write (STDERR_FILENO, message, strlen (message)) != strlen (message))
+            if (write (STDERR_FILENO, message, strlen (message)) !=
+                (ssize_t) strlen (message))
               {
                 /* ignore failure to write out a warning */
               }
@@ -111,7 +112,8 @@ signal_handler (int sig)
               "Unable to write termination signal to pipe - buffer full?\n"
               "Will exit instead.\n";
 
-            if (write (STDERR_FILENO, message, strlen (message)) != strlen (message))
+            if (write (STDERR_FILENO, message, strlen (message)) !=
+                (ssize_t) strlen (message))
               {
                 /* ignore failure to write out a warning */
               }