From 36189de425e2be7b58cc7b5cf1b854883612dce8 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Thu, 20 Jun 2013 19:43:46 +0200 Subject: [PATCH] Fix warning about unused result of write() in priv::callback_base::stop() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On systems with a strict compiler, the buildprocess will complain: [ 70%] Building CXX object src/CMakeFiles/conky.dir/update-cb.cc.o conky/src/update-cb.cc: In member function ‘void conky::priv::callback_base::stop()’: conky/src/update-cb.cc:49:34: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result This patch fixes this warning (and by doing this also checks if the write worked) --- src/update-cb.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/update-cb.cc b/src/update-cb.cc index 20fb2f0c..e2098016 100644 --- a/src/update-cb.cc +++ b/src/update-cb.cc @@ -22,6 +22,7 @@ */ #include "config.h" +#include "logging.h" #include "update-cb.hh" @@ -46,7 +47,8 @@ namespace conky { done = true; sem_start.post(); if(pipefd.second >= 0) - write(pipefd.second, "X", 1); + if(write(pipefd.second, "X", 1) != 1) + NORM_ERR("can't write 'X' to pipefd %d: %s", pipefd.second, strerror(errno)); thread->join(); delete thread; thread = NULL;