tree-wide: when %m is used in log_*, always specify errno explicitly
All those uses were correct, but I think it's better to be explicit. Using implicit errno is too error prone, and with this change we can require (in the sense of a style guideline) that the code is always specified. Helpful query: git grep -n -P 'log_[^s][a-z]+\(.*%m'
This commit is contained in:
@@ -724,10 +724,9 @@ static int path_set_xattrs(Item *i, const char *path) {
|
||||
|
||||
n = strlen(*value);
|
||||
log_debug("Setting extended attribute '%s=%s' on %s.", *name, *value, path);
|
||||
if (lsetxattr(path, *name, *value, n, 0) < 0) {
|
||||
log_error("Setting extended attribute %s=%s on %s failed: %m", *name, *value, path);
|
||||
return -errno;
|
||||
}
|
||||
if (lsetxattr(path, *name, *value, n, 0) < 0)
|
||||
return log_error_errno(errno, "Setting extended attribute %s=%s on %s failed: %m",
|
||||
*name, *value, path);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user