summaryrefslogtreecommitdiffstats
path: root/configd
diff options
context:
space:
mode:
authorArne H. Juul <arnej@pvv.ntnu.no>2016-06-24 13:17:12 +0200
committerArne H. Juul <arnej@pvv.ntnu.no>2016-07-02 14:47:30 +0200
commitbb94e3b36cce9d88ad24927445a372db03ef2b36 (patch)
treea2b7c9cc016a331ff338a06b2050ab083b996900 /configd
parent7d6f65499de1db475df68d53ecda67160635ab35 (diff)
avoid "unused result" warnings
Diffstat (limited to 'configd')
-rw-r--r--configd/src/apps/sentinel/command-connection.cpp5
-rw-r--r--configd/src/apps/sentinel/service.cpp4
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);
}