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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user