From bb94e3b36cce9d88ad24927445a372db03ef2b36 Mon Sep 17 00:00:00 2001 From: "Arne H. Juul" Date: Fri, 24 Jun 2016 13:17:12 +0200 Subject: avoid "unused result" warnings --- configd/src/apps/sentinel/command-connection.cpp | 5 ++++- configd/src/apps/sentinel/service.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'configd/src') diff --git a/configd/src/apps/sentinel/command-connection.cpp b/configd/src/apps/sentinel/command-connection.cpp index 9b35d801ecb..4bba9c62be9 100644 --- a/configd/src/apps/sentinel/command-connection.cpp +++ b/configd/src/apps/sentinel/command-connection.cpp @@ -50,7 +50,10 @@ CommandConnection::printf(const char *fmt, ...) int ret = vsnprintf(buf, sizeof buf, fmt, args); va_end(args); - write(_fd, buf, strlen(buf)); + size_t len = strlen(buf); + if (write(_fd, buf, strlen(buf) != len)) { + perror("CommandConnection::printf failed"); + } return ret; } diff --git a/configd/src/apps/sentinel/service.cpp b/configd/src/apps/sentinel/service.cpp index 9a1f3dc9c82..49944043259 100644 --- a/configd/src/apps/sentinel/service.cpp +++ b/configd/src/apps/sentinel/service.cpp @@ -337,7 +337,7 @@ Service::runChild(int pipes[2]) char buf[200]; snprintf(buf, sizeof buf, "open /dev/null for fd 0: got %d " "(%s)", fd, strerror(errno)); - write(pipes[1], buf, strlen(buf)); + (void) write(pipes[1], buf, strlen(buf)); _exit(EXIT_FAILURE); } fcntl(0, F_SETFD, 0); // Don't close on exec @@ -347,7 +347,7 @@ Service::runChild(int pipes[2]) char buf[200]; snprintf(buf, sizeof buf, "exec error: %s for /bin/sh -c '%s'", strerror(errno), _config->command.c_str()); - write(pipes[1], buf, strlen(buf)); + (void) write(pipes[1], buf, strlen(buf)); _exit(EXIT_FAILURE); } -- cgit v1.2.3