summaryrefslogtreecommitdiff
path: root/src/network/networkd.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/network/networkd.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/network/networkd.c')
-rw-r--r--src/network/networkd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/network/networkd.c b/src/network/networkd.c
index fdb80368d4..1020c72525 100644
--- a/src/network/networkd.c
+++ b/src/network/networkd.c
@@ -46,7 +46,7 @@ int main(int argc, char *argv[]) {
r = get_user_creds(&user, &uid, &gid, NULL, NULL);
if (r < 0) {
- log_error("Cannot resolve user name %s: %s", user, strerror(-r));
+ log_error_errno(-r, "Cannot resolve user name %s: %m", user);
goto out;
}
@@ -79,37 +79,37 @@ int main(int argc, char *argv[]) {
r = manager_new(&m);
if (r < 0) {
- log_error("Could not create manager: %s", strerror(-r));
+ log_error_errno(-r, "Could not create manager: %m");
goto out;
}
r = manager_udev_listen(m);
if (r < 0) {
- log_error("Could not connect to udev: %s", strerror(-r));
+ log_error_errno(-r, "Could not connect to udev: %m");
goto out;
}
r = manager_rtnl_listen(m);
if (r < 0) {
- log_error("Could not connect to rtnl: %s", strerror(-r));
+ log_error_errno(-r, "Could not connect to rtnl: %m");
goto out;
}
r = manager_bus_listen(m);
if (r < 0) {
- log_error("Could not connect to system bus: %s", strerror(-r));
+ log_error_errno(-r, "Could not connect to system bus: %m");
goto out;
}
r = manager_load_config(m);
if (r < 0) {
- log_error("Could not load configuration files: %s", strerror(-r));
+ log_error_errno(-r, "Could not load configuration files: %m");
goto out;
}
r = manager_rtnl_enumerate_links(m);
if (r < 0) {
- log_error("Could not enumerate links: %s", strerror(-r));
+ log_error_errno(-r, "Could not enumerate links: %m");
goto out;
}
@@ -119,7 +119,7 @@ int main(int argc, char *argv[]) {
r = sd_event_loop(m->event);
if (r < 0) {
- log_error("Event loop failed: %s", strerror(-r));
+ log_error_errno(-r, "Event loop failed: %m");
goto out;
}