From 2e09b2235a27df3ada3542a2402b6e1727fc2c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 1 Jun 2022 17:49:27 +0200 Subject: [PATCH] various: add %m in messages Sometimes we want to suppress strerror() message because the are providing something better. But in those cases, it seems it was just forgotten. --- src/core/bpf-lsm.c | 2 +- src/userdb/userwork.c | 2 +- src/volatile-root/volatile-root.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/bpf-lsm.c b/src/core/bpf-lsm.c index d3e92b98a62..46fc8c8d3b6 100644 --- a/src/core/bpf-lsm.c +++ b/src/core/bpf-lsm.c @@ -83,7 +83,7 @@ static int prepare_restrict_fs_bpf(struct restrict_fs_bpf **ret_obj) { r = restrict_fs_bpf__load(obj); assert(r <= 0); if (r < 0) - return log_error_errno(r, "Failed to load BPF object"); + return log_error_errno(r, "Failed to load BPF object: %m"); *ret_obj = TAKE_PTR(obj); diff --git a/src/userdb/userwork.c b/src/userdb/userwork.c index 18d58c308c0..490e42b0143 100644 --- a/src/userdb/userwork.c +++ b/src/userdb/userwork.c @@ -556,7 +556,7 @@ static int run(int argc, char *argv[]) { return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Parent already died?"); if (kill(parent, SIGUSR2) < 0) - return log_error_errno(errno, "Failed to kill our own parent."); + return log_error_errno(errno, "Failed to kill our own parent: %m"); } } diff --git a/src/volatile-root/volatile-root.c b/src/volatile-root/volatile-root.c index aa16582d9e4..e29d4df6925 100644 --- a/src/volatile-root/volatile-root.c +++ b/src/volatile-root/volatile-root.c @@ -127,7 +127,7 @@ static int run(int argc, char *argv[]) { r = query_volatile_mode(&m); if (r < 0) - return log_error_errno(r, "Failed to determine volatile mode from kernel command line."); + return log_error_errno(r, "Failed to determine volatile mode from kernel command line: %m"); if (r == 0 && argc >= 2) { /* The kernel command line always wins. However if nothing was set there, the argument passed here wins instead. */ m = volatile_mode_from_string(argv[1]);