From 75eab72cf3e5d70f55af52c62ea5adc11294dc26 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 1 Jan 2016 09:34:28 +0100 Subject: further improvement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/daemon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/daemon.c') diff --git a/src/daemon.c b/src/daemon.c index e4c444e..ee05cf7 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -103,6 +103,8 @@ pwriten(int fildes, const void *buf, size_t nbyte, size_t offset) /** * Wrapper for `read` that reads all available data. * + * `errno` is set to `EBADMSG` on success. + * * @param fd The file descriptor from which to to read. * @param buf Output parameter for the data. * @param n Output parameter for the number of read bytes. @@ -131,7 +133,7 @@ readall(int fd, char **buf, size_t *n) new = realloc(buffer, *n = ptr); *buf = ptr ? (new ? new : buffer) : NULL; shutdown(SOCK_FILENO, SHUT_RD); - return 0; + return errno = EBADMSG, 0; fail: saved_errno = errno; -- cgit v1.2.3-70-g09d2