diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 13:19:16 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 13:29:21 +0100 |
commit | da927ba997d68401563b927f92e6e40e021a8e5c (patch) | |
tree | 71764cd998aef07b8943c5206c9307a93ba9c528 /src/machine | |
parent | 0a1beeb64207eaa88ab9236787b1cbc2f704ae14 (diff) |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
Diffstat (limited to 'src/machine')
-rw-r--r-- | src/machine/machine.c | 4 | ||||
-rw-r--r-- | src/machine/machinectl.c | 20 | ||||
-rw-r--r-- | src/machine/machined.c | 24 |
3 files changed, 24 insertions, 24 deletions
diff --git a/src/machine/machine.c b/src/machine/machine.c index 88c10b7315..40189269e0 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -216,7 +216,7 @@ finish: if (temp_path) unlink(temp_path); - log_error_errno(-r, "Failed to save machine data %s: %m", m->state_file); + log_error_errno(r, "Failed to save machine data %s: %m", m->state_file); } return r; @@ -259,7 +259,7 @@ int machine_load(Machine *m) { if (r == -ENOENT) return 0; - log_error_errno(-r, "Failed to read %s: %m", m->state_file); + log_error_errno(r, "Failed to read %s: %m", m->state_file); return r; } diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 7ef6244c62..52cdfda627 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -415,7 +415,7 @@ static int show_info(const char *verb, sd_bus *bus, const char *path, bool *new_ map, &info); if (r < 0) { - log_error_errno(-r, "Could not get properties: %m"); + log_error_errno(r, "Could not get properties: %m"); return r; } @@ -445,7 +445,7 @@ static int show_properties(sd_bus *bus, const char *path, bool *new_line) { r = bus_print_all_properties(bus, "org.freedesktop.machine1", path, arg_property, arg_all); if (r < 0) - log_error_errno(-r, "Could not get properties: %m"); + log_error_errno(r, "Could not get properties: %m"); return r; } @@ -682,13 +682,13 @@ static int login_machine(sd_bus *bus, char **args, unsigned n) { r = sd_event_default(&event); if (r < 0) { - log_error_errno(-r, "Failed to get event loop: %m"); + log_error_errno(r, "Failed to get event loop: %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; } @@ -720,7 +720,7 @@ static int login_machine(sd_bus *bus, char **args, unsigned n) { &reply2, "u"); if (r < 0) { - log_error_errno(-r, "Failed to retrieve PID of leader: %m"); + log_error_errno(r, "Failed to retrieve PID of leader: %m"); return r; } @@ -730,7 +730,7 @@ static int login_machine(sd_bus *bus, char **args, unsigned n) { master = openpt_in_namespace(leader, O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY); if (master < 0) { - log_error_errno(-master, "Failed to acquire pseudo tty: %m"); + log_error_errno(master, "Failed to acquire pseudo tty: %m"); return master; } @@ -748,7 +748,7 @@ static int login_machine(sd_bus *bus, char **args, unsigned n) { r = sd_bus_open_system_container(&container_bus, args[1]); if (r < 0) { - log_error_errno(-r, "Failed to get container bus: %m"); + log_error_errno(r, "Failed to get container bus: %m"); return r; } @@ -786,13 +786,13 @@ static int login_machine(sd_bus *bus, char **args, unsigned n) { r = pty_forward_new(event, master, &forward); if (r < 0) { - log_error_errno(-r, "Failed to create PTY forwarder: %m"); + log_error_errno(r, "Failed to create PTY forwarder: %m"); return r; } r = sd_event_loop(event); if (r < 0) { - log_error_errno(-r, "Failed to run event loop: %m"); + log_error_errno(r, "Failed to run event loop: %m"); return r; } @@ -1029,7 +1029,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/machine/machined.c b/src/machine/machined.c index 7f03e8281d..2385fead6e 100644 --- a/src/machine/machined.c +++ b/src/machine/machined.c @@ -113,7 +113,7 @@ int manager_enumerate_machines(Manager *m) { k = manager_add_machine(m, de->d_name, &machine); if (k < 0) { - log_error_errno(-k, "Failed to add machine by file name %s: %m", de->d_name); + log_error_errno(k, "Failed to add machine by file name %s: %m", de->d_name); r = k; continue; @@ -138,25 +138,25 @@ static int manager_connect_bus(Manager *m) { r = sd_bus_default_system(&m->bus); if (r < 0) { - log_error_errno(-r, "Failed to connect to system bus: %m"); + log_error_errno(r, "Failed to connect to system bus: %m"); return r; } r = sd_bus_add_object_vtable(m->bus, NULL, "/org/freedesktop/machine1", "org.freedesktop.machine1.Manager", manager_vtable, m); if (r < 0) { - log_error_errno(-r, "Failed to add manager object vtable: %m"); + log_error_errno(r, "Failed to add manager object vtable: %m"); return r; } r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/machine1/machine", "org.freedesktop.machine1.Machine", machine_vtable, machine_object_find, m); if (r < 0) { - log_error_errno(-r, "Failed to add machine object vtable: %m"); + log_error_errno(r, "Failed to add machine object vtable: %m"); return r; } r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/machine1/machine", machine_node_enumerator, m); if (r < 0) { - log_error_errno(-r, "Failed to add machine enumerator: %m"); + log_error_errno(r, "Failed to add machine enumerator: %m"); return r; } @@ -170,7 +170,7 @@ static int manager_connect_bus(Manager *m) { match_job_removed, m); if (r < 0) { - log_error_errno(-r, "Failed to add match for JobRemoved: %m"); + log_error_errno(r, "Failed to add match for JobRemoved: %m"); return r; } @@ -184,7 +184,7 @@ static int manager_connect_bus(Manager *m) { match_unit_removed, m); if (r < 0) { - log_error_errno(-r, "Failed to add match for UnitRemoved: %m"); + log_error_errno(r, "Failed to add match for UnitRemoved: %m"); return r; } @@ -197,7 +197,7 @@ static int manager_connect_bus(Manager *m) { match_properties_changed, m); if (r < 0) { - log_error_errno(-r, "Failed to add match for PropertiesChanged: %m"); + log_error_errno(r, "Failed to add match for PropertiesChanged: %m"); return r; } @@ -211,7 +211,7 @@ static int manager_connect_bus(Manager *m) { match_reloading, m); if (r < 0) { - log_error_errno(-r, "Failed to add match for Reloading: %m"); + log_error_errno(r, "Failed to add match for Reloading: %m"); return r; } @@ -230,13 +230,13 @@ static int manager_connect_bus(Manager *m) { r = sd_bus_request_name(m->bus, "org.freedesktop.machine1", 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(m->bus, m->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; } @@ -335,7 +335,7 @@ int main(int argc, char *argv[]) { r = manager_startup(m); if (r < 0) { - log_error_errno(-r, "Failed to fully start up daemon: %m"); + log_error_errno(r, "Failed to fully start up daemon: %m"); goto finish; } |