summaryrefslogtreecommitdiff
path: root/src/login/logind.c
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/login/logind.c
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/login/logind.c')
-rw-r--r--src/login/logind.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/login/logind.c b/src/login/logind.c
index 78220ff4dd..b44f376427 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -290,7 +290,7 @@ static int manager_enumerate_seats(Manager *m) {
if (errno == ENOENT)
return 0;
- log_error("Failed to open /run/systemd/seats: %m");
+ log_error_errno(errno, "Failed to open /run/systemd/seats: %m");
return -errno;
}
@@ -327,7 +327,7 @@ static int manager_enumerate_linger_users(Manager *m) {
if (errno == ENOENT)
return 0;
- log_error("Failed to open /var/lib/systemd/linger/: %m");
+ log_error_errno(errno, "Failed to open /var/lib/systemd/linger/: %m");
return -errno;
}
@@ -363,7 +363,7 @@ static int manager_enumerate_users(Manager *m) {
if (errno == ENOENT)
return 0;
- log_error("Failed to open /run/systemd/users: %m");
+ log_error_errno(errno, "Failed to open /run/systemd/users: %m");
return -errno;
}
@@ -404,7 +404,7 @@ static int manager_enumerate_sessions(Manager *m) {
if (errno == ENOENT)
return 0;
- log_error("Failed to open /run/systemd/sessions: %m");
+ log_error_errno(errno, "Failed to open /run/systemd/sessions: %m");
return -errno;
}
@@ -451,7 +451,7 @@ static int manager_enumerate_inhibitors(Manager *m) {
if (errno == ENOENT)
return 0;
- log_error("Failed to open /run/systemd/inhibit: %m");
+ log_error_errno(errno, "Failed to open /run/systemd/inhibit: %m");
return -errno;
}
@@ -568,7 +568,7 @@ static int manager_reserve_vt(Manager *m) {
/* Don't complain on VT-less systems */
if (errno != ENOENT)
- log_warning("Failed to pin reserved VT: %m");
+ log_warning_errno(errno, "Failed to pin reserved VT: %m");
return -errno;
}
@@ -753,7 +753,7 @@ static int manager_connect_console(Manager *m) {
if (errno == ENOENT)
return 0;
- log_error("Failed to open /sys/class/tty/tty0/active: %m");
+ log_error_errno(errno, "Failed to open /sys/class/tty/tty0/active: %m");
return -errno;
}