diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/analyze/analyze-verify.c | 4 | ||||
-rw-r--r-- | src/analyze/analyze.c | 2 | ||||
-rw-r--r-- | src/basic/fs-util.c | 2 | ||||
-rw-r--r-- | src/boot/bootctl.c | 2 | ||||
-rw-r--r-- | src/busctl/busctl.c | 38 | ||||
-rw-r--r-- | src/cgtop/cgtop.c | 12 | ||||
-rw-r--r-- | src/core/cgroup.c | 2 | ||||
-rw-r--r-- | src/core/device.c | 2 | ||||
-rw-r--r-- | src/core/machine-id-setup.c | 7 | ||||
-rw-r--r-- | src/core/main.c | 33 | ||||
-rw-r--r-- | src/core/mount.c | 2 | ||||
-rw-r--r-- | src/core/service.c | 6 | ||||
-rw-r--r-- | src/core/shutdown.c | 12 | ||||
-rw-r--r-- | src/core/smack-setup.c | 8 | ||||
-rw-r--r-- | src/coredump/coredump.c | 2 | ||||
-rw-r--r-- | src/coredump/coredumpctl.c | 4 | ||||
-rw-r--r-- | src/dissect/dissect.c | 2 | ||||
-rw-r--r-- | src/firstboot/firstboot.c | 2 | ||||
-rw-r--r-- | src/gpt-auto-generator/gpt-auto-generator.c | 2 | ||||
-rw-r--r-- | src/import/pull.c | 4 | ||||
-rw-r--r-- | src/nspawn/nspawn-settings.c | 2 |
21 files changed, 76 insertions, 74 deletions
diff --git a/src/analyze/analyze-verify.c b/src/analyze/analyze-verify.c index 402203a3c7..42f2a8f345 100644 --- a/src/analyze/analyze-verify.c +++ b/src/analyze/analyze-verify.c @@ -179,9 +179,9 @@ static int verify_documentation(Unit *u, bool check_man) { k = show_man_page(*p + 4, true); if (k != 0) { if (k < 0) - log_unit_error_errno(u, r, "Can't show %s: %m", *p); + log_unit_error_errno(u, k, "Can't show %s: %m", *p + 4); else { - log_unit_error_errno(u, r, "man %s command failed with code %d", *p + 4, k); + log_unit_error(u, "Command 'man %s' failed with code %d", *p + 4, k); k = -ENOEXEC; } if (r == 0) diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index e3671969ec..144f18e9c7 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -506,7 +506,7 @@ static int pretty_boot_time(sd_bus *bus, char **_buf) { "ActiveEnterTimestampMonotonic", &activated_time); if (r < 0) { - log_info_errno(r, "Could not get time to reach default.target. Continuing..."); + log_info_errno(r, "Could not get time to reach default.target, ignoring: %m"); activated_time = USEC_INFINITY; } diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 3d83fc9b10..91e83962b8 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -1173,7 +1173,7 @@ int unlinkat_deallocate(int fd, const char *name, int flags) { return 0; if (fstat(truncate_fd, &st) < 0) { - log_debug_errno(errno, "Failed to stat file '%s' for deallocation, ignoring.", name); + log_debug_errno(errno, "Failed to stat file '%s' for deallocation, ignoring: %m", name); return 0; } diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index c97d21c228..d1aee188eb 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -242,7 +242,7 @@ static int status_variables(void) { if (n_order == -ENOENT) n_order = 0; else if (n_order < 0) - return log_error_errno(n_order, "Failed to read EFI boot order."); + return log_error_errno(n_order, "Failed to read EFI boot order: %m"); /* print entries in BootOrder first */ printf("Boot Loaders Listed in EFI Variables:\n"); diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 2f056ac834..9c872ff0aa 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -1356,7 +1356,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = parse_boolean(v); if (r < 0) - return log_error_errno(r, "Failed to parse as boolean: %s", v); + return log_error_errno(r, "Failed to parse '%s' as boolean: %m", v); r = sd_bus_message_append_basic(m, t, &r); break; @@ -1366,7 +1366,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou8(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as byte (unsigned 8bit integer): %s", v); + return log_error_errno(r, "Failed to parse '%s' as byte (unsigned 8bit integer): %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1377,7 +1377,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atoi16(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as signed 16bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as signed 16bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1388,7 +1388,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou16(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as unsigned 16bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as unsigned 16bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1399,7 +1399,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atoi32(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as signed 32bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as signed 32bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1410,7 +1410,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou32(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as unsigned 32bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as unsigned 32bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1421,7 +1421,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atoi64(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as signed 64bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as signed 64bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1432,7 +1432,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou64(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as unsigned 64bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as unsigned 64bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1443,7 +1443,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atod(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as double precision floating point: %s", v); + return log_error_errno(r, "Failed to parse '%s' as double precision floating point: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1462,11 +1462,11 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou32(v, &n); if (r < 0) - return log_error_errno(r, "Failed to parse number of array entries: %s", v); + return log_error_errno(r, "Failed to parse '%s' number of array entries: %m", v); r = signature_element_length(signature, &k); if (r < 0) - return log_error_errno(r, "Invalid array signature."); + return log_error_errno(r, "Invalid array signature: %m"); { unsigned i; @@ -1512,7 +1512,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = signature_element_length(signature, &k); if (r < 0) - return log_error_errno(r, "Invalid struct/dict entry signature."); + return log_error_errno(r, "Invalid struct/dict entry signature: %m"); { char s[k-1]; @@ -2285,7 +2285,7 @@ static int parse_argv(int argc, char *argv[]) { r = parse_size(optarg, 1024, &sz); if (r < 0) - return log_error_errno(r, "Failed to parse size: %s", optarg); + return log_error_errno(r, "Failed to parse size '%s': %m", optarg); if ((uint64_t) (size_t) sz != sz) { log_error("Size out of range."); @@ -2321,7 +2321,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_EXPECT_REPLY: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --expect-reply= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --expect-reply= parameter '%s': %m", optarg); arg_expect_reply = r; break; @@ -2329,7 +2329,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_AUTO_START: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --auto-start= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --auto-start= parameter '%s': %m", optarg); arg_auto_start = r; break; @@ -2337,7 +2337,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_ALLOW_INTERACTIVE_AUTHORIZATION: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --allow-interactive-authorization= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --allow-interactive-authorization= parameter '%s': %m", optarg); arg_allow_interactive_authorization = r; break; @@ -2345,14 +2345,14 @@ static int parse_argv(int argc, char *argv[]) { case ARG_TIMEOUT: r = parse_sec(optarg, &arg_timeout); if (r < 0) - return log_error_errno(r, "Failed to parse --timeout= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --timeout= parameter '%s': %m", optarg); break; case ARG_AUGMENT_CREDS: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --augment-creds= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --augment-creds= parameter '%s': %m", optarg); arg_augment_creds = r; break; @@ -2360,7 +2360,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_WATCH_BIND: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --watch-bind= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --watch-bind= parameter '%s': %m", optarg); arg_watch_bind = r; break; diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index e4123e5f07..69a5fde732 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -805,14 +805,16 @@ static int parse_argv(int argc, char *argv[]) { case ARG_DEPTH: r = safe_atou(optarg, &arg_depth); if (r < 0) - return log_error_errno(r, "Failed to parse depth parameter: %s", optarg); + return log_error_errno(r, "Failed to parse depth parameter '%s': %m", optarg); break; case 'd': r = parse_sec(optarg, &arg_delay); - if (r < 0 || arg_delay <= 0) { - log_error("Failed to parse delay parameter: %s", optarg); + if (r < 0) + return log_error_errno(r, "Failed to parse delay parameter '%s': %m", optarg); + if (arg_delay <= 0) { + log_error("Invalid delay parameter '%s'", optarg); return -EINVAL; } @@ -821,7 +823,7 @@ static int parse_argv(int argc, char *argv[]) { case 'n': r = safe_atou(optarg, &arg_iterations); if (r < 0) - return log_error_errno(r, "Failed to parse iterations parameter: %s", optarg); + return log_error_errno(r, "Failed to parse iterations parameter '%s': %m", optarg); break; @@ -885,7 +887,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_RECURSIVE: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --recursive= argument: %s", optarg); + return log_error_errno(r, "Failed to parse --recursive= argument '%s': %m", optarg); arg_recursive = r; arg_recursive_unset = r == 0; diff --git a/src/core/cgroup.c b/src/core/cgroup.c index e4341c6245..cf30e4e1d1 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -1948,7 +1948,7 @@ void unit_release_cgroup(Unit *u) { if (u->cgroup_inotify_wd >= 0) { if (inotify_rm_watch(u->manager->cgroup_inotify_fd, u->cgroup_inotify_wd) < 0) - log_unit_debug_errno(u, errno, "Failed to remove cgroup inotify watch %i for %s, ignoring", u->cgroup_inotify_wd, u->id); + log_unit_debug_errno(u, errno, "Failed to remove cgroup inotify watch %i for %s, ignoring: %m", u->cgroup_inotify_wd, u->id); (void) hashmap_remove(u->manager->cgroup_inotify_wd_unit, INT_TO_PTR(u->cgroup_inotify_wd)); u->cgroup_inotify_wd = -1; diff --git a/src/core/device.c b/src/core/device.c index 16c1cf19fa..82e38853ab 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -254,7 +254,7 @@ static int device_deserialize_item(Unit *u, const char *key, const char *value, } else if (streq(key, "found")) { r = device_found_from_string_many(value, &d->deserialized_found); if (r < 0) - log_unit_debug_errno(u, r, "Failed to parse found value, ignoring: %s", value); + log_unit_debug_errno(u, r, "Failed to parse found value '%s', ignoring: %m", value); } else log_unit_debug(u, "Unknown serialization key: %s", key); diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c index 11528f83c4..248a83847e 100644 --- a/src/core/machine-id-setup.c +++ b/src/core/machine-id-setup.c @@ -73,7 +73,7 @@ static int generate_machine_id(const char *root, sd_id128_t *ret) { /* If that didn't work, generate a random machine id */ r = sd_id128_randomize(ret); if (r < 0) - return log_error_errno(r, "Failed to generate randomized : %m"); + return log_error_errno(r, "Failed to generate randomized machine ID: %m"); log_info("Initializing machine ID from random generator."); return 0; @@ -108,8 +108,7 @@ int machine_id_setup(const char *root, sd_id128_t machine_id, sd_id128_t *ret) { "2) /etc/machine-id exists and is empty.\n" "3) /etc/machine-id is missing and /etc is writable.\n"); else - return log_error_errno(errno, - "Cannot open %s: %m", etc_machine_id); + return log_error_errno(errno, "Cannot open %s: %m", etc_machine_id); } writable = false; @@ -208,7 +207,7 @@ int machine_id_commit(const char *root) { r = id128_read_fd(fd, ID128_PLAIN, &id); if (r < 0) - return log_error_errno(r, "We didn't find a valid machine ID in %s.", etc_machine_id); + return log_error_errno(r, "We didn't find a valid machine ID in %s: %m", etc_machine_id); fd = safe_close(fd); diff --git a/src/core/main.c b/src/core/main.c index 1a95486c03..851a3933bf 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -349,7 +349,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat r = value ? parse_boolean(value) : true; if (r < 0) - log_warning("Failed to parse dump core switch %s. Ignoring.", value); + log_warning_errno(r, "Failed to parse dump core switch %s, ignoring: %m", value); else arg_dump_core = r; @@ -367,14 +367,17 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat if (!value) arg_crash_chvt = 0; /* turn on */ - else if (parse_crash_chvt(value) < 0) - log_warning("Failed to parse crash chvt switch %s. Ignoring.", value); + else { + r = parse_crash_chvt(value); + if (r < 0) + log_warning_errno(r, "Failed to parse crash chvt switch %s, ignoring: %m", value); + } } else if (proc_cmdline_key_streq(key, "systemd.crash_shell")) { r = value ? parse_boolean(value) : true; if (r < 0) - log_warning("Failed to parse crash shell switch %s. Ignoring.", value); + log_warning_errno(r, "Failed to parse crash shell switch %s, ignoring: %m", value); else arg_crash_shell = r; @@ -382,7 +385,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat r = value ? parse_boolean(value) : true; if (r < 0) - log_warning("Failed to parse crash reboot switch %s. Ignoring.", value); + log_warning_errno(r, "Failed to parse crash reboot switch %s, ignoring: %m", value); else arg_crash_reboot = r; @@ -391,17 +394,15 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat r = parse_confirm_spawn(value, &s); if (r < 0) - log_warning_errno(r, "Failed to parse confirm_spawn switch %s. Ignoring.", value); - else { - free(arg_confirm_spawn); - arg_confirm_spawn = s; - } + log_warning_errno(r, "Failed to parse confirm_spawn switch %s, ignoring: %m", value); + else + free_and_replace(arg_confirm_spawn, s); } else if (proc_cmdline_key_streq(key, "systemd.service_watchdogs")) { r = value ? parse_boolean(value) : true; if (r < 0) - log_warning("Failed to parse service watchdog switch %s. Ignoring.", value); + log_warning_errno(r, "Failed to parse service watchdog switch %s, ignoring: %m", value); else arg_service_watchdogs = r; @@ -410,7 +411,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat if (value) { r = parse_show_status(value, &arg_show_status); if (r < 0) - log_warning("Failed to parse show status switch %s. Ignoring.", value); + log_warning_errno(r, "Failed to parse show status switch %s, ignoring: %m", value); } else arg_show_status = SHOW_STATUS_YES; @@ -421,7 +422,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat r = exec_output_from_string(value); if (r < 0) - log_warning("Failed to parse default standard output switch %s. Ignoring.", value); + log_warning_errno(r, "Failed to parse default standard output switch %s, ignoring: %m", value); else arg_default_std_output = r; @@ -432,7 +433,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat r = exec_output_from_string(value); if (r < 0) - log_warning("Failed to parse default standard error switch %s. Ignoring.", value); + log_warning_errno(r, "Failed to parse default standard error switch %s, ignoring: %m", value); else arg_default_std_error = r; @@ -459,7 +460,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat r = set_machine_id(value); if (r < 0) - log_warning("MachineID '%s' is not valid. Ignoring.", value); + log_warning_errno(r, "MachineID '%s' is not valid, ignoring: %m", value); } else if (proc_cmdline_key_streq(key, "systemd.default_timeout_start_sec")) { @@ -468,7 +469,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat r = parse_sec(value, &arg_default_timeout_start_usec); if (r < 0) - log_warning_errno(r, "Failed to parse default start timeout: %s, ignoring.", value); + log_warning_errno(r, "Failed to parse default start timeout '%s', ignoring: %m", value); if (arg_default_timeout_start_usec <= 0) arg_default_timeout_start_usec = USEC_INFINITY; diff --git a/src/core/mount.c b/src/core/mount.c index 9894e64f9d..cc6464e356 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1784,7 +1784,7 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents, if (r == 0) rescan = true; else if (r < 0) - return log_error_errno(r, "Failed to drain libmount events"); + return log_error_errno(r, "Failed to drain libmount events: %m"); } while (r == 0); log_debug("libmount event [rescan: %s]", yes_no(rescan)); diff --git a/src/core/service.c b/src/core/service.c index 660536837e..e3d7e4069f 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -2754,7 +2754,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value, r = cunescape(value, 0, &t); if (r < 0) - log_unit_debug_errno(u, r, "Failed to unescape status text: %s", value); + log_unit_debug_errno(u, r, "Failed to unescape status text '%s': %m", value); else free_and_replace(s->status_text, t); @@ -2763,7 +2763,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value, r = manager_load_unit(u->manager, value, NULL, NULL, &socket); if (r < 0) - log_unit_debug_errno(u, r, "Failed to load accept-socket unit: %s", value); + log_unit_debug_errno(u, r, "Failed to load accept-socket unit '%s': %m", value); else { unit_ref_set(&s->accept_socket, u, socket); SOCKET(socket)->n_connections++; @@ -3735,7 +3735,7 @@ static void service_notify_message( status_errno = parse_errno(e); if (status_errno < 0) log_unit_warning_errno(u, status_errno, - "Failed to parse ERRNO= field in notification message: %s", e); + "Failed to parse ERRNO= field value '%s' in notification message: %m", e); else if (s->status_errno != status_errno) { s->status_errno = status_errno; notify_dbus = true; diff --git a/src/core/shutdown.c b/src/core/shutdown.c index 62d953659c..181e08de23 100644 --- a/src/core/shutdown.c +++ b/src/core/shutdown.c @@ -77,14 +77,14 @@ static int parse_argv(int argc, char *argv[]) { case ARG_LOG_LEVEL: r = log_set_max_level_from_string(optarg); if (r < 0) - log_error_errno(r, "Failed to parse log level %s, ignoring.", optarg); + log_error_errno(r, "Failed to parse log level %s, ignoring: %m", optarg); break; case ARG_LOG_TARGET: r = log_set_target_from_string(optarg); if (r < 0) - log_error_errno(r, "Failed to parse log target %s, ignoring", optarg); + log_error_errno(r, "Failed to parse log target %s, ignoring: %m", optarg); break; @@ -93,7 +93,7 @@ static int parse_argv(int argc, char *argv[]) { if (optarg) { r = log_show_color_from_string(optarg); if (r < 0) - log_error_errno(r, "Failed to parse log color setting %s, ignoring", optarg); + log_error_errno(r, "Failed to parse log color setting %s, ignoring: %m", optarg); } else log_show_color(true); @@ -103,7 +103,7 @@ static int parse_argv(int argc, char *argv[]) { if (optarg) { r = log_show_location_from_string(optarg); if (r < 0) - log_error_errno(r, "Failed to parse log location setting %s, ignoring", optarg); + log_error_errno(r, "Failed to parse log location setting %s, ignoring: %m", optarg); } else log_show_location(true); @@ -112,14 +112,14 @@ static int parse_argv(int argc, char *argv[]) { case ARG_EXIT_CODE: r = safe_atou8(optarg, &arg_exit_code); if (r < 0) - log_error_errno(r, "Failed to parse exit code %s, ignoring", optarg); + log_error_errno(r, "Failed to parse exit code %s, ignoring: %m", optarg); break; case ARG_TIMEOUT: r = parse_sec(optarg, &arg_timeout); if (r < 0) - log_error_errno(r, "Failed to parse shutdown timeout %s, ignoring", optarg); + log_error_errno(r, "Failed to parse shutdown timeout %s, ignoring: %m", optarg); break; diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c index 4aa839ea22..47138b863a 100644 --- a/src/core/smack-setup.c +++ b/src/core/smack-setup.c @@ -106,7 +106,7 @@ static int write_access2_rules(const char* srcdir) { if (write(isempty(acc2) ? load2_fd : change_fd, buf, strlen(buf)) < 0) { if (r == 0) r = -errno; - log_error_errno(errno, "Failed to write '%s' to '%s' in '%s'", + log_error_errno(errno, "Failed to write '%s' to '%s' in '%s': %m", buf, isempty(acc2) ? "/sys/fs/smackfs/load2" : "/sys/fs/smackfs/change-rule", entry->d_name); } } @@ -181,7 +181,7 @@ static int write_cipso2_rules(const char* srcdir) { if (write(cipso2_fd, buf, strlen(buf)) < 0) { if (r == 0) r = -errno; - log_error_errno(errno, "Failed to write '%s' to '/sys/fs/smackfs/cipso2' in '%s'", + log_error_errno(errno, "Failed to write '%s' to '/sys/fs/smackfs/cipso2' in '%s': %m", buf, entry->d_name); break; } @@ -253,7 +253,7 @@ static int write_netlabel_rules(const char* srcdir) { if (!fputs(buf, dst)) { if (r == 0) r = -EINVAL; - log_error_errno(errno, "Failed to write line to /sys/fs/smackfs/netlabel"); + log_error_errno(errno, "Failed to write line to /sys/fs/smackfs/netlabel: %m"); break; } q = fflush_and_check(dst); @@ -410,7 +410,7 @@ int mac_smack_setup(bool *loaded_policy) { log_info("Successfully wrote Smack onlycap list."); break; default: - log_emergency_errno(r, "Failed to write Smack onlycap list."); + log_emergency_errno(r, "Failed to write Smack onlycap list: %m"); return r; } diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index d3fc059fbb..e54c69a931 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -340,7 +340,7 @@ static int save_external_coredump( r = safe_atou64(context[CONTEXT_RLIMIT], &rlimit); if (r < 0) - return log_error_errno(r, "Failed to parse resource limit: %s", context[CONTEXT_RLIMIT]); + return log_error_errno(r, "Failed to parse resource limit '%s': %m", context[CONTEXT_RLIMIT]); if (rlimit < page_size()) { /* Is coredumping disabled? Then don't bother saving/processing the coredump. * Anything below PAGE_SIZE cannot give a readable coredump (the kernel uses diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 8c08c64884..49df8656b6 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -237,13 +237,13 @@ static int parse_argv(int argc, char *argv[]) { case 'S': r = parse_timestamp(optarg, &arg_since); if (r < 0) - return log_error_errno(r, "Failed to parse timestamp: %s", optarg); + return log_error_errno(r, "Failed to parse timestamp '%s': %m", optarg); break; case 'U': r = parse_timestamp(optarg, &arg_until); if (r < 0) - return log_error_errno(r, "Failed to parse timestamp: %s", optarg); + return log_error_errno(r, "Failed to parse timestamp '%s': %m", optarg); break; case 'F': diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index 0adeee6691..86fa84337b 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -106,7 +106,7 @@ static int parse_argv(int argc, char *argv[]) { r = unhexmem(optarg, strlen(optarg), &p, &l); if (r < 0) - return log_error_errno(r, "Failed to parse root hash: %s", optarg); + return log_error_errno(r, "Failed to parse root hash '%s': %m", optarg); if (l < sizeof(sd_id128_t)) { log_error("Root hash must be at least 128bit long: %s", optarg); free(p); diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 552e10d157..6a939aec04 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -952,7 +952,7 @@ int main(int argc, char *argv[]) { r = proc_cmdline_get_bool("systemd.firstboot", &enabled); if (r < 0) { - log_error_errno(r, "Failed to parse systemd.firstboot= kernel command line argument, ignoring."); + log_error_errno(r, "Failed to parse systemd.firstboot= kernel command line argument, ignoring: %m"); goto finish; } if (r > 0 && !enabled) { diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 6b75221426..08fdd960ba 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -561,7 +561,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat r = value ? parse_boolean(value) : 1; if (r < 0) - log_warning("Failed to parse gpt-auto switch \"%s\". Ignoring.", value); + log_warning_errno(r, "Failed to parse gpt-auto switch \"%s\", ignoring: %m", value); else arg_enabled = r; diff --git a/src/import/pull.c b/src/import/pull.c index 26be5bbf0b..ef495de068 100644 --- a/src/import/pull.c +++ b/src/import/pull.c @@ -280,7 +280,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_SETTINGS: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --settings= parameter '%s'", optarg); + return log_error_errno(r, "Failed to parse --settings= parameter '%s': %m", optarg); arg_settings = r; break; @@ -288,7 +288,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_ROOTHASH: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --roothash= parameter '%s'", optarg); + return log_error_errno(r, "Failed to parse --roothash= parameter '%s': %m", optarg); arg_roothash = r; break; diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c index 62a3486952..264ec61ad9 100644 --- a/src/nspawn/nspawn-settings.c +++ b/src/nspawn/nspawn-settings.c @@ -391,7 +391,7 @@ int config_parse_network_zone( j = strappend("vz-", rvalue); if (!ifname_valid(j)) { - log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid network zone name %s, ignoring: %m", rvalue); + log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid network zone name, ignoring: %s", rvalue); return 0; } |