From 23446f01480e1d6f72a03d71f9c67cbf34ddaf3b Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Thu, 1 Oct 2015 11:04:08 +0200 Subject: tree-wide: add missing errno arguments to log_*_errno() A few of the recent conversions to log_*_errno() were missing the errno value arguments. Fixes: e53fc357a9b "tree-wide: remove a number of invocations of strerror() and replace by %m" --- src/core/smack-setup.c | 2 +- src/libsystemd/sd-device/sd-device.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c index 6618aa501d..761582c7a2 100644 --- a/src/core/smack-setup.c +++ b/src/core/smack-setup.c @@ -222,7 +222,7 @@ int mac_smack_setup(bool *loaded_policy) { #ifdef SMACK_RUN_LABEL r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, 0); if (r) - log_warning_errno("Failed to set SMACK label \"%s\" on self: %m", SMACK_RUN_LABEL); + log_warning_errno(r, "Failed to set SMACK label \"%s\" on self: %m", SMACK_RUN_LABEL); #endif r = write_cipso2_rules("/etc/smack/cipso.d/"); diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 8ffe994d80..ca231858c0 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -172,7 +172,7 @@ int device_set_syspath(sd_device *device, const char *_syspath, bool verify) { return log_debug_errno(errno, "sd-device: could not canonicalize '%s': %m", _syspath); } } else if (r < 0) { - log_debug_errno("sd-device: could not get target of '%s': %m", _syspath); + log_debug_errno(r, "sd-device: could not get target of '%s': %m", _syspath); return r; } @@ -568,7 +568,7 @@ int device_read_uevent_file(sd_device *device) { if (major) { r = device_set_devnum(device, major, minor); if (r < 0) - log_debug_errno("sd-device: could not set 'MAJOR=%s' or 'MINOR=%s' from '%s': %m", major, minor, path); + log_debug_errno(r, "sd-device: could not set 'MAJOR=%s' or 'MINOR=%s' from '%s': %m", major, minor, path); } return 0; -- cgit v1.2.3-54-g00ecf From 19c29853804f8806866695d743fd4e3586996dbb Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Thu, 1 Oct 2015 11:18:05 +0200 Subject: sd-device: fix format strings after conversion to log_*_errno() Use %m where previously %s was used together with strerrno(). Fixes: e53fc357a9b "tree-wide: remove a number of invocations of strerror() and replace by %m" --- src/libsystemd/sd-device/sd-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index ca231858c0..c528a157c1 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -554,7 +554,7 @@ int device_read_uevent_file(sd_device *device) { r = handle_uevent_line(device, key, value, &major, &minor); if (r < 0) - log_debug_errno(r, "sd-device: failed to handle uevent entry '%s=%s': %s", key, value); + log_debug_errno(r, "sd-device: failed to handle uevent entry '%s=%s': %m", key, value); state = PRE_KEY; } @@ -1315,7 +1315,7 @@ int device_read_db_aux(sd_device *device, bool force) { db[i] = '\0'; r = handle_db_line(device, key, value); if (r < 0) - log_debug_errno(r, "sd-device: failed to handle db entry '%c:%s': %s", key, value); + log_debug_errno(r, "sd-device: failed to handle db entry '%c:%s': %m", key, value); state = PRE_KEY; } -- cgit v1.2.3-54-g00ecf From 46b57b6eece0ed9b67cd199af484046e50487589 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Thu, 1 Oct 2015 11:28:40 +0200 Subject: udev: fix format string after conversion to log_*_errno() Use %m where previously %s was used together with strerrno(). Fixes: e53fc357a9b "tree-wide: remove a number of invocations of strerror() and replace by %m" --- src/udev/udev-rules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index e5a066aa1e..83c1793751 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -2514,7 +2514,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, rules_str(rules, rule->rule.filename_off), rule->rule.filename_line); r = sysctl_write(filename, value); if (r < 0) - log_error_errno(r, "error writing SYSCTL{%s}='%s': %s", filename, value); + log_error_errno(r, "error writing SYSCTL{%s}='%s': %m", filename, value); break; } case TK_A_RUN_BUILTIN: -- cgit v1.2.3-54-g00ecf