summaryrefslogtreecommitdiff
path: root/src/core/namespace.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:29:59 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:49:27 +0100
commit56f64d95763a799ba4475daf44d8e9f72a1bd474 (patch)
tree4c38253c718dc1972b811fa7c01ebfa3c2b7776c /src/core/namespace.c
parent895b3a7b44fe7ca2f260986be2a877ff56a72718 (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/namespace.c')
-rw-r--r--src/core/namespace.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/namespace.c b/src/core/namespace.c
index a2025459f1..32338cdc60 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;
}