From: Florian Forster Date: Sun, 22 Jun 2008 09:01:18 +0000 (+0200) Subject: src/rrdd.c: Complain if write(2) fails. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0438ab41dd8c97b1b480ee6149efaacd5ba7476c;p=rrdd.git src/rrdd.c: Complain if write(2) fails. --- diff --git a/src/rrdd.c b/src/rrdd.c index 14543ce..94ddf40 100644 --- a/src/rrdd.c +++ b/src/rrdd.c @@ -188,6 +188,7 @@ static int handle_request_update (int fd, /* {{{ */ char *value; char *buffer_ptr; int values_num = 0; + int status; time_t now; @@ -305,7 +306,13 @@ static int handle_request_update (int fd, /* {{{ */ snprintf (answer, sizeof (answer), "0 Enqueued %i value(s)\n", values_num); answer[sizeof (answer) - 1] = 0; - write (fd, answer, sizeof (answer)); + status = write (fd, answer, sizeof (answer)); + if (status < 0) + { + status = errno; + RRDD_LOG (LOG_INFO, "handle_request_update: write(2) returned an error."); + return (status); + } return (0); } /* }}} int handle_request_update */