1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-29 13:39:10 +00:00

Fix warning about unused result of write() in priv::callback_base::stop()

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)
This commit is contained in:
Nikolas Garofil 2013-06-20 19:43:46 +02:00
parent c272852bcb
commit 36189de425

View File

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