From: Sebastian Harl Date: Fri, 27 Feb 2015 16:31:29 +0000 (+0100) Subject: Check the return value of write() to satisfy GCC's unused-result checks. X-Git-Tag: sysdb-0.8.0~162^2~2 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=77da93ea783d99a888e703f5e30f369f0991401b Check the return value of write() to satisfy GCC's unused-result checks. --- 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));