X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Ftimedate%2Ftimedatectl.c;h=9b81513c75456664b2749c5898318b2a54e470d5;hp=54b39a1806f4775dff15d6835f003d3a7e5ba84f;hb=145b1f799ff6712f333cef92c44218254a1320c5;hpb=46e65dcc3a522b5e992e165b5e61d14254026859 diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 54b39a180..9b81513c7 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -194,7 +194,6 @@ static void print_status_info(const StatusInfo *i) { } static int show_status(sd_bus *bus, char **args, unsigned n) { - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; StatusInfo info = {}; static const struct bus_properties_map map[] = { { "Timezone", "s", NULL, offsetof(StatusInfo, timezone) }, @@ -215,8 +214,10 @@ static int show_status(sd_bus *bus, char **args, unsigned n) { "/org/freedesktop/timedate1", map, &info); - if (r < 0) + if (r < 0) { + log_error("Failed to query server: %s", strerror(-r)); goto fail; + } print_status_info(&info); @@ -411,21 +412,20 @@ static int help(void) { printf("%s [OPTIONS...] COMMAND ...\n\n" "Query or change system time and date settings.\n\n" - " -h --help Show this help\n" - " --version Show package version\n" - " --adjust-system-clock\n" - " Adjust system clock when changing local RTC mode\n" - " --no-pager Do not pipe output into a pager\n" - " --no-ask-password Do not prompt for password\n" - " -H --host=[USER@]HOST Operate on remote host\n" - " -M --machine=CONTAINER Operate on local container\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " --no-pager Do not pipe output into a pager\n" + " --no-ask-password Do not prompt for password\n" + " -H --host=[USER@]HOST Operate on remote host\n" + " -M --machine=CONTAINER Operate on local container\n" + " --adjust-system-clock Adjust system clock when changing local RTC mode\n\n" "Commands:\n" - " status Show current time settings\n" - " set-time TIME Set system time\n" - " set-timezone ZONE Set system timezone\n" - " list-timezones Show known timezones\n" - " set-local-rtc BOOL Control whether RTC is in local time\n" - " set-ntp BOOL Control whether NTP is enabled\n", + " status Show current time settings\n" + " set-time TIME Set system time\n" + " set-timezone ZONE Set system timezone\n" + " list-timezones Show known timezones\n" + " set-local-rtc BOOL Control whether RTC is in local time\n" + " set-ntp BOOL Control whether NTP is enabled\n", program_invocation_short_name); return 0;