summaryrefslogtreecommitdiff
path: root/src/journal/coredump-vacuum.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/journal/coredump-vacuum.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/journal/coredump-vacuum.c')
-rw-r--r--src/journal/coredump-vacuum.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/journal/coredump-vacuum.c b/src/journal/coredump-vacuum.c
index fec901e8e4..5f2ff2a025 100644
--- a/src/journal/coredump-vacuum.c
+++ b/src/journal/coredump-vacuum.c
@@ -140,7 +140,7 @@ int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
if (exclude_fd >= 0) {
if (fstat(exclude_fd, &exclude_st) < 0) {
- log_error("Failed to fstat(): %m");
+ log_error_errno(errno, "Failed to fstat(): %m");
return -errno;
}
}
@@ -156,7 +156,7 @@ int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
if (errno == ENOENT)
return 0;
- log_error("Can't open coredump directory: %m");
+ log_error_errno(errno, "Can't open coredump directory: %m");
return -errno;
}
@@ -258,7 +258,7 @@ int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
if (errno == ENOENT)
continue;
- log_error("Failed to remove file %s: %m", worst->oldest_file);
+ log_error_errno(errno, "Failed to remove file %s: %m", worst->oldest_file);
return -errno;
} else
log_info("Removed old coredump %s.", worst->oldest_file);
@@ -267,6 +267,6 @@ int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
return 0;
fail:
- log_error("Failed to read directory: %m");
+ log_error_errno(errno, "Failed to read directory: %m");
return -errno;
}