From 77da93ea783d99a888e703f5e30f369f0991401b Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 27 Feb 2015 17:31:29 +0100 Subject: [PATCH] Check the return value of write() to satisfy GCC's unused-result checks. --- src/frontend/sock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/sock.c b/src/frontend/sock.c index cf187fc..1f3ec5f 100644 --- a/src/frontend/sock.c +++ b/src/frontend/sock.c @@ -570,7 +570,11 @@ connection_handler(void *data) "connection %s to list of open connections", SDB_OBJ(conn)->name); } - write(sock->trigger[TRIGGER_WRITE], "", 1); + if (write(sock->trigger[TRIGGER_WRITE], "", 1) <= 0) { + /* This shouldn't happen and it's not critical; in the worst cases + * it slows us down. */ + sdb_log(SDB_LOG_WARNING, "frontend: Failed to trigger main loop"); + } /* pass ownership back to list; or destroy in case of an error */ sdb_object_deref(SDB_OBJ(conn)); -- 2.30.2