summaryrefslogtreecommitdiff
path: root/src/machine/machined.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 11:58:34 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 12:04:41 +0100
commit0a1beeb64207eaa88ab9236787b1cbc2f704ae14 (patch)
tree50117277be2e2078d0373b944a30b4f09bb94443 /src/machine/machined.c
parentb4d23205f238e06aaa31264628e20669e714acad (diff)
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
Diffstat (limited to 'src/machine/machined.c')
-rw-r--r--src/machine/machined.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/machine/machined.c b/src/machine/machined.c
index 966475b242..7f03e8281d 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("Failed to add machine by file name %s: %s", de->d_name, strerror(-k));
+ 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("Failed to connect to system bus: %s", strerror(-r));
+ 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("Failed to add manager object vtable: %s", strerror(-r));
+ 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("Failed to add machine object vtable: %s", strerror(-r));
+ 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("Failed to add machine enumerator: %s", strerror(-r));
+ 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("Failed to add match for JobRemoved: %s", strerror(-r));
+ 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("Failed to add match for UnitRemoved: %s", strerror(-r));
+ 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("Failed to add match for PropertiesChanged: %s", strerror(-r));
+ 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("Failed to add match for Reloading: %s", strerror(-r));
+ 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("Failed to register name: %s", strerror(-r));
+ 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("Failed to attach bus to event loop: %s", strerror(-r));
+ 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("Failed to fully start up daemon: %s", strerror(-r));
+ log_error_errno(-r, "Failed to fully start up daemon: %m");
goto finish;
}