diff options
author | Daniel Buch <boogiewasthere@gmail.com> | 2013-11-26 09:38:02 +0100 |
---|---|---|
committer | David Strauss <david@davidstrauss.net> | 2013-11-26 21:07:46 +1000 |
commit | f5f6d0e25574dd63fb605b81fa7767dd71c454db (patch) | |
tree | 3ec0b42888ce9b6895ec264c2a18a394c6d3db3e /src/initctl/initctl.c | |
parent | 34a6dc7dcaa47a9efe083acc6f5fc6263414465e (diff) | |
download | systemd-f5f6d0e25574dd63fb605b81fa7767dd71c454db.tar.gz systemd-f5f6d0e25574dd63fb605b81fa7767dd71c454db.tar.bz2 systemd-f5f6d0e25574dd63fb605b81fa7767dd71c454db.zip |
tree-wide usage of %m specifier instead of strerror(errno)
Also for log_error() except where a specific error is specified
e.g. errno ? strerror(errno) : "Some user specified message"
Diffstat (limited to 'src/initctl/initctl.c')
-rw-r--r-- | src/initctl/initctl.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c index 0000d6ccd4..284319f9af 100644 --- a/src/initctl/initctl.c +++ b/src/initctl/initctl.c @@ -217,7 +217,7 @@ static int fifo_process(Fifo *f) { if (errno == EAGAIN) return 0; - log_warning("Failed to read from fifo: %s", strerror(errno)); + log_warning("Failed to read from fifo: %m"); return -1; } @@ -278,7 +278,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: %s", strerror(errno)); + log_error("Failed to create epoll object: %m"); goto fail; } @@ -305,8 +305,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: %s", - strerror(errno)); + log_error("Failed to create fifo object: %m"); goto fail; } @@ -318,8 +317,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: %s", - strerror(errno)); + log_error("Failed to add fifo fd to epoll object: %m"); goto fail; } @@ -416,7 +414,7 @@ int main(int argc, char *argv[]) { if (errno == EINTR) continue; - log_error("epoll_wait() failed: %s", strerror(errno)); + log_error("epoll_wait() failed: %m"); goto fail; } |