summaryrefslogtreecommitdiff
path: root/src/initctl
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:29:59 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:49:27 +0100
commit56f64d95763a799ba4475daf44d8e9f72a1bd474 (patch)
tree4c38253c718dc1972b811fa7c01ebfa3c2b7776c /src/initctl
parent895b3a7b44fe7ca2f260986be2a877ff56a72718 (diff)
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
Diffstat (limited to 'src/initctl')
-rw-r--r--src/initctl/initctl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c
index a0745af716..d7cd4ba29f 100644
--- a/src/initctl/initctl.c
+++ b/src/initctl/initctl.c
@@ -162,7 +162,7 @@ static void request_process(Server *s, const struct init_request *req) {
case 'u':
case 'U':
if (kill(1, SIGTERM) < 0)
- log_error("kill() failed: %m");
+ log_error_errno(errno, "kill() failed: %m");
/* The bus connection will be
* terminated if PID 1 is reexecuted,
@@ -175,7 +175,7 @@ static void request_process(Server *s, const struct init_request *req) {
case 'q':
case 'Q':
if (kill(1, SIGHUP) < 0)
- log_error("kill() failed: %m");
+ log_error_errno(errno, "kill() failed: %m");
break;
default:
@@ -217,7 +217,7 @@ static int fifo_process(Fifo *f) {
if (errno == EAGAIN)
return 0;
- log_warning("Failed to read from fifo: %m");
+ log_warning_errno(errno, "Failed to read from fifo: %m");
return -errno;
}
@@ -277,7 +277,7 @@ static int server_init(Server *s, unsigned n_sockets) {
s->epoll_fd = epoll_create1(EPOLL_CLOEXEC);
if (s->epoll_fd < 0) {
r = -errno;
- log_error("Failed to create epoll object: %m");
+ log_error_errno(errno, "Failed to create epoll object: %m");
goto fail;
}
@@ -303,7 +303,7 @@ static int server_init(Server *s, unsigned n_sockets) {
f = new0(Fifo, 1);
if (!f) {
r = -ENOMEM;
- log_error("Failed to create fifo object: %m");
+ log_error_errno(errno, "Failed to create fifo object: %m");
goto fail;
}
@@ -315,7 +315,7 @@ static int server_init(Server *s, unsigned n_sockets) {
if (epoll_ctl(s->epoll_fd, EPOLL_CTL_ADD, fd, &ev) < 0) {
r = -errno;
fifo_free(f);
- log_error("Failed to add fifo fd to epoll object: %m");
+ log_error_errno(errno, "Failed to add fifo fd to epoll object: %m");
goto fail;
}
@@ -413,7 +413,7 @@ int main(int argc, char *argv[]) {
if (errno == EINTR)
continue;
- log_error("epoll_wait() failed: %m");
+ log_error_errno(errno, "epoll_wait() failed: %m");
goto fail;
}