chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
logind: handle closing sessions over daemon restarts
[elogind.git]
/
src
/
timedate
/
timedatectl.c
diff --git
a/src/timedate/timedatectl.c
b/src/timedate/timedatectl.c
index 36c3f3cfcd083d913d3dfe828de0a0df8188be84..74f40b9c80082c4027dbee5cca937319a79bf7d5 100644
(file)
--- a/
src/timedate/timedatectl.c
+++ b/
src/timedate/timedatectl.c
@@
-232,7
+232,7
@@
static int show_status(sd_bus *bus, char **args, unsigned n) {
map,
&info);
if (r < 0) {
map,
&info);
if (r < 0) {
- log_error
("Failed to query server: %s", strerror(-r)
);
+ log_error
_errno(r, "Failed to query server: %m"
);
goto fail;
}
goto fail;
}
@@
-363,10
+363,8
@@
static int list_timezones(sd_bus *bus, char **args, unsigned n) {
assert(n == 1);
r = get_timezones(&zones);
assert(n == 1);
r = get_timezones(&zones);
- if (r < 0) {
- log_error("Failed to read list of time zones: %s", strerror(-r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to read list of time zones: %m");
pager_open_if_enabled();
strv_print(zones);
pager_open_if_enabled();
strv_print(zones);
@@
-438,7
+436,7
@@
static int parse_argv(int argc, char *argv[]) {
break;
case 'M':
break;
case 'M':
- arg_transport = BUS_TRANSPORT_
CONTAINER
;
+ arg_transport = BUS_TRANSPORT_
MACHINE
;
arg_host = optarg;
break;
arg_host = optarg;
break;
@@
-545,7
+543,7
@@
static int timedatectl_main(sd_bus *bus, int argc, char *argv[]) {
}
int main(int argc, char *argv[]) {
}
int main(int argc, char *argv[]) {
- _cleanup_bus_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_
close_
unref_ sd_bus *bus = NULL;
int r;
setlocale(LC_ALL, "");
int r;
setlocale(LC_ALL, "");
@@
-558,7
+556,7
@@
int main(int argc, char *argv[]) {
r = bus_open_transport(arg_transport, arg_host, false, &bus);
if (r < 0) {
r = bus_open_transport(arg_transport, arg_host, false, &bus);
if (r < 0) {
- log_error
("Failed to create bus connection: %s", strerror(-r)
);
+ log_error
_errno(r, "Failed to create bus connection: %m"
);
goto finish;
}
goto finish;
}