From 4ae25393f37b96b2b753562a349d68947ab1ad3d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 7 Aug 2018 10:14:30 +0900 Subject: tree-wide: shorten error logging a bit Continuation of 4027f96aa08c73f109aa46b89842ca0e25c9c0e9. --- src/timedate/timedatectl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/timedate') diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index befc8cb723..a541b01920 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -204,9 +204,9 @@ static int set_time(int argc, char **argv, void *userdata) { NULL, "xbb", (int64_t) t, relative, interactive); if (r < 0) - log_error("Failed to set time: %s", bus_error_message(&error, r)); + return log_error_errno(r, "Failed to set time: %s", bus_error_message(&error, r)); - return r; + return 0; } static int set_timezone(int argc, char **argv, void *userdata) { @@ -225,9 +225,9 @@ static int set_timezone(int argc, char **argv, void *userdata) { NULL, "sb", argv[1], arg_ask_password); if (r < 0) - log_error("Failed to set time zone: %s", bus_error_message(&error, r)); + return log_error_errno(r, "Failed to set time zone: %s", bus_error_message(&error, r)); - return r; + return 0; } static int set_local_rtc(int argc, char **argv, void *userdata) { @@ -250,9 +250,9 @@ static int set_local_rtc(int argc, char **argv, void *userdata) { NULL, "bbb", b, arg_adjust_system_clock, arg_ask_password); if (r < 0) - log_error("Failed to set local RTC: %s", bus_error_message(&error, r)); + return log_error_errno(r, "Failed to set local RTC: %s", bus_error_message(&error, r)); - return r; + return 0; } static int set_ntp(int argc, char **argv, void *userdata) { @@ -275,9 +275,9 @@ static int set_ntp(int argc, char **argv, void *userdata) { NULL, "bb", b, arg_ask_password); if (r < 0) - log_error("Failed to set ntp: %s", bus_error_message(&error, r)); + return log_error_errno(r, "Failed to set ntp: %s", bus_error_message(&error, r)); - return r; + return 0; } static int list_timezones(int argc, char **argv, void *userdata) { -- cgit v1.2.3