diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:29:59 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:49:27 +0100 |
commit | 56f64d95763a799ba4475daf44d8e9f72a1bd474 (patch) | |
tree | 4c38253c718dc1972b811fa7c01ebfa3c2b7776c /src/core/cgroup.c | |
parent | 895b3a7b44fe7ca2f260986be2a877ff56a72718 (diff) |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments.
Diffstat (limited to 'src/core/cgroup.c')
-rw-r--r-- | src/core/cgroup.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c index c24bfc8d33..382e6a6ccc 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -154,7 +154,7 @@ static int lookup_blkio_device(const char *p, dev_t *dev) { r = stat(p, &st); if (r < 0) { - log_warning("Couldn't stat device %s: %m", p); + log_warning_errno(errno, "Couldn't stat device %s: %m", p); return -errno; } @@ -219,7 +219,7 @@ static int whitelist_major(const char *path, const char *name, char type, const f = fopen("/proc/devices", "re"); if (!f) { - log_warning("Cannot open /proc/devices to resolve %s (%c): %m", name, type); + log_warning_errno(errno, "Cannot open /proc/devices to resolve %s (%c): %m", name, type); return -errno; } @@ -280,7 +280,7 @@ static int whitelist_major(const char *path, const char *name, char type, const return 0; fail: - log_warning("Failed to read /proc/devices: %m"); + log_warning_errno(errno, "Failed to read /proc/devices: %m"); return -errno; } @@ -906,7 +906,7 @@ int manager_setup_cgroup(Manager *m) { m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK); if (m->pin_cgroupfs_fd < 0) { - log_error("Failed to open pin file: %m"); + log_error_errno(errno, "Failed to open pin file: %m"); return -errno; } |