diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 17:09:20 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 17:17:51 +0100 |
commit | c33b329709ebe2755181980a050d02ec7c81ed87 (patch) | |
tree | 39080c428c72c90daddbe1c08d45c181adf1476c /src/core/manager.c | |
parent | 5567fafbc9d83a1391f23ecdbe698a3c03929370 (diff) |
treewide: more log_*_errno() conversions, multiline calls
Basically:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \
$f; done
Plus manual indentation fixups.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index ef58bdd161..c56c1621b0 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -238,7 +238,7 @@ static int manager_dispatch_ask_password_fd(sd_event_source *source, if (m->have_ask_password < 0) /* Log error but continue. Negative have_ask_password * is treated as unknown status. */ - log_error("Failed to list /run/systemd/ask-password: %s", strerror(m->have_ask_password)); + log_error_errno(m->have_ask_password, "Failed to list /run/systemd/ask-password: %m"); return 0; } @@ -730,7 +730,7 @@ static int manager_setup_kdbus(Manager *m) { m->running_as == SYSTEMD_SYSTEM, &p); if (m->kdbus_fd < 0) { - log_debug("Failed to set up kdbus: %s", strerror(-m->kdbus_fd)); + log_debug_errno(m->kdbus_fd, "Failed to set up kdbus: %m"); return m->kdbus_fd; } @@ -2699,8 +2699,7 @@ static int create_generator_dir(Manager *m, char **generator, const char *name) r = mkdir_p_label(p, 0755); if (r < 0) { - log_error("Failed to create generator directory %s: %s", - p, strerror(-r)); + log_error_errno(r, "Failed to create generator directory %s: %m", p); free(p); return r; } @@ -2716,8 +2715,7 @@ static int create_generator_dir(Manager *m, char **generator, const char *name) r = mkdir_p_label(p, 0755); if (r < 0) { - log_error("Failed to create generator directory %s: %s", - p, strerror(-r)); + log_error_errno(r, "Failed to create generator directory %s: %m", p); free(p); return r; } |