summaryrefslogtreecommitdiffstats
path: root/src/timedate
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 13:19:16 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 13:29:21 +0100
commitda927ba997d68401563b927f92e6e40e021a8e5c (patch)
tree71764cd998aef07b8943c5206c9307a93ba9c528 /src/timedate
parenttreewide: auto-convert the simple cases to log_*_errno() (diff)
downloadsystemd-da927ba997d68401563b927f92e6e40e021a8e5c.tar.xz
systemd-da927ba997d68401563b927f92e6e40e021a8e5c.zip
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
Diffstat (limited to 'src/timedate')
-rw-r--r--src/timedate/timedatectl.c6
-rw-r--r--src/timedate/timedated.c22
2 files changed, 14 insertions, 14 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index f8d2af97d4..65cae0bd69 100644
--- 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) {
- log_error_errno(-r, "Failed to query server: %m");
+ log_error_errno(r, "Failed to query server: %m");
goto fail;
}
@@ -364,7 +364,7 @@ static int list_timezones(sd_bus *bus, char **args, unsigned n) {
r = get_timezones(&zones);
if (r < 0) {
- log_error_errno(-r, "Failed to read list of time zones: %m");
+ log_error_errno(r, "Failed to read list of time zones: %m");
return r;
}
@@ -558,7 +558,7 @@ int main(int argc, char *argv[]) {
r = bus_open_transport(arg_transport, arg_host, false, &bus);
if (r < 0) {
- log_error_errno(-r, "Failed to create bus connection: %m");
+ log_error_errno(r, "Failed to create bus connection: %m");
goto finish;
}
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 5391f5b18f..867b29412c 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -74,7 +74,7 @@ static int context_read_data(Context *c) {
if (r == -EINVAL)
log_warning("/etc/localtime should be a symbolic link to a time zone data file in /usr/share/zoneinfo/.");
else
- log_warning_errno(-r, "Failed to get target of /etc/localtime: %m");
+ log_warning_errno(r, "Failed to get target of /etc/localtime: %m");
} else {
const char *e;
@@ -411,7 +411,7 @@ static int method_set_timezone(sd_bus *bus, sd_bus_message *m, void *userdata, s
/* 1. Write new configuration file */
r = context_write_data_timezone(c);
if (r < 0) {
- log_error_errno(-r, "Failed to set time zone: %m");
+ log_error_errno(r, "Failed to set time zone: %m");
return sd_bus_error_set_errnof(error, r, "Failed to set time zone: %s", strerror(-r));
}
@@ -467,7 +467,7 @@ static int method_set_local_rtc(sd_bus *bus, sd_bus_message *m, void *userdata,
/* 1. Write new configuration file */
r = context_write_data_local_rtc(c);
if (r < 0) {
- log_error_errno(-r, "Failed to set RTC to local/UTC: %m");
+ log_error_errno(r, "Failed to set RTC to local/UTC: %m");
return sd_bus_error_set_errnof(error, r, "Failed to set RTC to local/UTC: %s", strerror(-r));
}
@@ -650,25 +650,25 @@ static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) {
r = sd_bus_default_system(&bus);
if (r < 0) {
- log_error_errno(-r, "Failed to get system bus connection: %m");
+ log_error_errno(r, "Failed to get system bus connection: %m");
return r;
}
r = sd_bus_add_object_vtable(bus, NULL, "/org/freedesktop/timedate1", "org.freedesktop.timedate1", timedate_vtable, c);
if (r < 0) {
- log_error_errno(-r, "Failed to register object: %m");
+ log_error_errno(r, "Failed to register object: %m");
return r;
}
r = sd_bus_request_name(bus, "org.freedesktop.timedate1", 0);
if (r < 0) {
- log_error_errno(-r, "Failed to register name: %m");
+ log_error_errno(r, "Failed to register name: %m");
return r;
}
r = sd_bus_attach_event(bus, event, 0);
if (r < 0) {
- log_error_errno(-r, "Failed to attach bus to event loop: %m");
+ log_error_errno(r, "Failed to attach bus to event loop: %m");
return r;
}
@@ -698,7 +698,7 @@ int main(int argc, char *argv[]) {
r = sd_event_default(&event);
if (r < 0) {
- log_error_errno(-r, "Failed to allocate event loop: %m");
+ log_error_errno(r, "Failed to allocate event loop: %m");
goto finish;
}
@@ -710,19 +710,19 @@ int main(int argc, char *argv[]) {
r = context_read_data(&context);
if (r < 0) {
- log_error_errno(-r, "Failed to read time zone data: %m");
+ log_error_errno(r, "Failed to read time zone data: %m");
goto finish;
}
r = context_read_ntp(&context, bus);
if (r < 0) {
- log_error_errno(-r, "Failed to determine whether NTP is enabled: %m");
+ log_error_errno(r, "Failed to determine whether NTP is enabled: %m");
goto finish;
}
r = bus_event_loop_with_idle(event, bus, "org.freedesktop.timedate1", DEFAULT_EXIT_USEC, NULL, NULL);
if (r < 0) {
- log_error_errno(-r, "Failed to run event loop: %m");
+ log_error_errno(r, "Failed to run event loop: %m");
goto finish;
}