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.
This commit is contained in:
Michal Schmidt
2014-11-28 19:49:27 +01:00
parent 895b3a7b44
commit 56f64d9576
139 changed files with 741 additions and 728 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ static int apply_file(struct kmod_ctx *ctx, const char *path, bool ignore_enoent
if (feof(f))
break;
log_error("Failed to read file '%s', ignoring: %m", path);
log_error_errno(errno, "Failed to read file '%s', ignoring: %m", path);
return -errno;
}