diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:29:59 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:49:27 +0100 |
commit | 56f64d95763a799ba4475daf44d8e9f72a1bd474 (patch) | |
tree | 4c38253c718dc1972b811fa7c01ebfa3c2b7776c /src/core/dbus.c | |
parent | 895b3a7b44fe7ca2f260986be2a877ff56a72718 (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/core/dbus.c')
-rw-r--r-- | src/core/dbus.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c index 7291bdc3f3..925fac96b4 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -624,7 +624,7 @@ static int bus_on_connection(sd_event_source *s, int fd, uint32_t revents, void nfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK|SOCK_CLOEXEC); if (nfd < 0) { - log_warning("Failed to accept private connection, ignoring: %m"); + log_warning_errno(errno, "Failed to accept private connection, ignoring: %m"); return 0; } @@ -959,19 +959,19 @@ static int bus_init_private(Manager *m) { fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); if (fd < 0) { - log_error("Failed to allocate private socket: %m"); + log_error_errno(errno, "Failed to allocate private socket: %m"); return -errno; } r = bind(fd, &sa.sa, salen); if (r < 0) { - log_error("Failed to bind private socket: %m"); + log_error_errno(errno, "Failed to bind private socket: %m"); return -errno; } r = listen(fd, SOMAXCONN); if (r < 0) { - log_error("Failed to make private socket listening: %m"); + log_error_errno(errno, "Failed to make private socket listening: %m"); return -errno; } |