From 56f64d95763a799ba4475daf44d8e9f72a1bd474 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 28 Nov 2014 19:29:59 +0100 Subject: 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. --- src/core/namespace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/core/namespace.c') diff --git a/src/core/namespace.c b/src/core/namespace.c index a2025459f..32338cdc6 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -277,7 +277,7 @@ static int mount_kdbus(BindMount *m) { u = umask(0000); if (!mkdtemp(temporary_mount)) { - log_error("Failed create temp dir: %m"); + log_error_errno(errno, "Failed create temp dir: %m"); return -errno; } @@ -291,21 +291,21 @@ static int mount_kdbus(BindMount *m) { /* create a new /dev/null dev node copy so we have some fodder to * bind-mount the custom endpoint over. */ if (stat("/dev/null", &st) < 0) { - log_error("Failed to stat /dev/null: %m"); + log_error_errno(errno, "Failed to stat /dev/null: %m"); r = -errno; goto fail; } busnode = strappenda(root, "/bus"); if (mknod(busnode, (st.st_mode & ~07777) | 0600, st.st_rdev) < 0) { - log_error("mknod() for %s failed: %m", busnode); + log_error_errno(errno, "mknod() for %s failed: %m", busnode); r = -errno; goto fail; } r = mount(m->path, busnode, "bind", MS_BIND, NULL); if (r < 0) { - log_error("bind mount of %s failed: %m", m->path); + log_error_errno(errno, "bind mount of %s failed: %m", m->path); r = -errno; goto fail; } @@ -317,7 +317,7 @@ static int mount_kdbus(BindMount *m) { } if (mount(root, basepath, NULL, MS_MOVE, NULL) < 0) { - log_error("bind mount of %s failed: %m", basepath); + log_error_errno(errno, "bind mount of %s failed: %m", basepath); r = -errno; goto fail; } -- cgit v1.2.3