summaryrefslogtreecommitdiff
path: root/src/locale
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-08-07 10:14:30 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-08-07 10:14:33 +0900
commit4ae25393f37b96b2b753562a349d68947ab1ad3d (patch)
tree3ca5d2f931b2ab4760f70a218b5eb704f8a1445a /src/locale
parent906119c04632224c7c0d46671eb3f1dd303cacbf (diff)
downloadsystemd-4ae25393f37b96b2b753562a349d68947ab1ad3d.tar.gz
tree-wide: shorten error logging a bit
Continuation of 4027f96aa08c73f109aa46b89842ca0e25c9c0e9.
Diffstat (limited to 'src/locale')
-rw-r--r--src/locale/localectl.c14
-rw-r--r--src/locale/localed.c5
2 files changed, 9 insertions, 10 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index b3ad2820d9..ebc6a8ca8a 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -184,10 +184,8 @@ static int set_locale(int argc, char **argv, void *userdata) {
return bus_log_create_error(r);
r = sd_bus_call(bus, m, 0, &error, NULL);
- if (r < 0) {
- log_error("Failed to issue method call: %s", bus_error_message(&error, -r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to issue method call: %s", bus_error_message(&error, -r));
return 0;
}
@@ -229,9 +227,9 @@ static int set_vconsole_keymap(int argc, char **argv, void *userdata) {
NULL,
"ssbb", map, toggle_map, arg_convert, arg_ask_password);
if (r < 0)
- log_error("Failed to set keymap: %s", bus_error_message(&error, -r));
+ return log_error_errno(r, "Failed to set keymap: %s", bus_error_message(&error, -r));
- return r;
+ return 0;
}
static int list_vconsole_keymaps(int argc, char **argv, void *userdata) {
@@ -273,9 +271,9 @@ static int set_x11_keymap(int argc, char **argv, void *userdata) {
"ssssbb", layout, model, variant, options,
arg_convert, arg_ask_password);
if (r < 0)
- log_error("Failed to set keymap: %s", bus_error_message(&error, -r));
+ return log_error_errno(r, "Failed to set keymap: %s", bus_error_message(&error, -r));
- return r;
+ return 0;
}
static int list_x11_keymaps(int argc, char **argv, void *userdata) {
diff --git a/src/locale/localed.c b/src/locale/localed.c
index 71115c59d7..1f0c3ac74f 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -104,8 +104,9 @@ static int vconsole_reload(sd_bus *bus) {
"ss", "systemd-vconsole-setup.service", "replace");
if (r < 0)
- log_error("Failed to issue method call: %s", bus_error_message(&error, -r));
- return r;
+ return log_error_errno(r, "Failed to issue method call: %s", bus_error_message(&error, -r));
+
+ return 0;
}
static int vconsole_convert_to_x11_and_emit(Context *c, sd_bus_message *m) {