diff options
author | Arne H. Juul <arnej@pvv.ntnu.no> | 2016-06-24 13:17:12 +0200 |
---|---|---|
committer | Arne H. Juul <arnej@pvv.ntnu.no> | 2016-07-02 14:47:30 +0200 |
commit | bb94e3b36cce9d88ad24927445a372db03ef2b36 (patch) | |
tree | a2b7c9cc016a331ff338a06b2050ab083b996900 /configd | |
parent | 7d6f65499de1db475df68d53ecda67160635ab35 (diff) |
avoid "unused result" warnings
Diffstat (limited to 'configd')
-rw-r--r-- | configd/src/apps/sentinel/command-connection.cpp | 5 | ||||
-rw-r--r-- | configd/src/apps/sentinel/service.cpp | 4 |
2 files changed, 6 insertions, 3 deletions
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); } |