From 8cc6e67c16211c3ef6b13ee3694af649dba1f60d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 4 May 2019 11:26:27 +0200 Subject: [PATCH] main: check return value of write() Fixes build with -D_FORTIFY_SOURCE=2 --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 28d996a..927b586 100644 --- a/main.c +++ b/main.c @@ -179,7 +179,8 @@ main(int argc, const char *const *argv) LOG_INFO("aborted: %s (%d)", strsignal(aborted), aborted); /* Signal abort to other threads */ - write(abort_fd, &(uint64_t){1}, sizeof(uint64_t)); + if (write(abort_fd, &(uint64_t){1}, sizeof(uint64_t)) != sizeof(uint64_t)) + LOG_ERRNO("failed to signal abort to threads"); int res; int r = thrd_join(bar_thread, &res);