From 2450cbe7a6a88bebb55b0f12e0c12f685f5a38cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 4 May 2019 11:28:17 +0200 Subject: [PATCH] bar: xcb: check return values of ftruncate(), read() and write() Fixes building with -D_FORTIFY_SOURCE=2 --- bar/xcb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bar/xcb.c b/bar/xcb.c index 30fdba0..f2dcd3c 100644 --- a/bar/xcb.c +++ b/bar/xcb.c @@ -311,7 +311,11 @@ loop(struct bar *_bar, if (fds[1].revents & POLLHUP) { LOG_WARN("disconnected from XCB"); - write(_bar->abort_fd, &(uint64_t){1}, sizeof(uint64_t)); + if (write(_bar->abort_fd, &(uint64_t){1}, sizeof(uint64_t)) + != sizeof(uint64_t)) + { + LOG_ERRNO("failed to signal abort to modules"); + } break; }