Fix build error: unused-result
authorChengwei Yang <chengwei.yang@intel.com>
Fri, 31 May 2013 07:02:45 +0000 (15:02 +0800)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 5 Jun 2013 16:27:54 +0000 (17:27 +0100)
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
bus/main.c

index ca0be3c..970c1de 100644 (file)
@@ -91,7 +91,10 @@ signal_handler (int sig)
             static const char message[] =
               "Unable to write to reload pipe - buffer full?\n";
 
-            write (STDERR_FILENO, message, strlen (message));
+            if (write (STDERR_FILENO, message, strlen (message)) != strlen (message))
+              {
+                /* ignore failure to write out a warning */
+              }
           }
       }
       break;
@@ -113,7 +116,10 @@ signal_handler (int sig)
               "Unable to write termination signal to pipe - buffer full?\n"
               "Will exit instead.\n";
 
-            write (STDERR_FILENO, message, strlen (message));
+            if (write (STDERR_FILENO, message, strlen (message)) != strlen (message))
+              {
+                /* ignore failure to write out a warning */
+              }
             _exit (1);
           }
       }