aboutsummaryrefslogtreecommitdiff
path: root/src/rc/rc-logger.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-30 19:56:43 +0100
committerRoy Marples <roy@marples.name>2009-04-30 19:56:43 +0100
commit3d0e5175d845c2386295cf454f9ee1939265fe59 (patch)
treeab5fd50b99e05e3aaca755aaffaa8b0c0e52ba5a /src/rc/rc-logger.c
parent21e45e895ce3ca586e0c5fd89a68b84c01d270de (diff)
Avoid more gcc warning about not checking return values ...
Diffstat (limited to 'src/rc/rc-logger.c')
-rw-r--r--src/rc/rc-logger.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c
index f0320778..0f2c1f95 100644
--- a/src/rc/rc-logger.c
+++ b/src/rc/rc-logger.c
@@ -100,8 +100,9 @@ write_log(int logfd, const char *buffer, size_t bytes)
break;
}
- if (! in_escape) {
- write(logfd, p++, 1);
+ if (!in_escape) {
+ if (write(logfd, p++, 1) == -1)
+ eerror("write: %s", strerror(errno));
continue;
}
@@ -128,7 +129,8 @@ rc_logger_close(void)
int sig = SIGTERM;
if (signal_pipe[1] > -1) {
- write(signal_pipe[1], &sig, sizeof(sig));
+ if (write(signal_pipe[1], &sig, sizeof(sig)) == -1)
+ eerror("write: %s", strerror(errno));
close(signal_pipe[1]);
signal_pipe[1] = -1;
}
@@ -218,7 +220,8 @@ rc_logger_open(const char *level)
if (fd[1].revents & (POLLIN | POLLHUP)) {
memset(buffer, 0, BUFSIZ);
bytes = read(rc_logger_tty, buffer, BUFSIZ);
- write(STDOUT_FILENO, buffer, bytes);
+ if (write(STDOUT_FILENO, buffer, bytes) == -1)
+ eerror("write: %s", strerror(errno));
if (log)
write_log(fileno (log), buffer, bytes);
@@ -255,7 +258,8 @@ rc_logger_open(const char *level)
/* Try and cat our new logfile to a more permament location
and then punt it */
- system(MOVELOG);
+ if (system(MOVELOG) == -1)
+ eerror("system: %s: %s", MOVELOG, strerror(errno));
exit(0);
/* NOTREACHED */