[PATCH v2] Fix build error: unused-result

Chengwei Yang chengwei.yang at intel.com
Thu May 30 06:56:15 PDT 2013


Signed-off-by: Chengwei Yang <chengwei.yang at intel.com>
---
 bus/main.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/bus/main.c b/bus/main.c
index ca0be3c..72b5051 100644
--- a/bus/main.c
+++ b/bus/main.c
@@ -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);
           }
       }
-- 
1.7.9.5



More information about the dbus mailing list