tree-wide: fix a number of log calls that use %m but have no errno set
This is mostly fall-out from d1a1f0aaf0,
however some cases are older bugs.
There might be more issues lurking, this was a simple grep for "%m"
across the tree, with all lines removed that mention "errno" at all.
This commit is contained in:
@@ -1156,8 +1156,10 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||
r = extract_first_word(&w, &path, ":", EXTRACT_DONT_COALESCE_SEPARATORS);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to parse argument: %m");
|
||||
if (r == 0)
|
||||
return log_error("Failed to parse argument: %m");
|
||||
if (r == 0) {
|
||||
log_error("Failed to parse argument: %s", p);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = sd_bus_message_append(m, "(ss)", path, w);
|
||||
if (r < 0)
|
||||
|
||||
@@ -303,8 +303,8 @@ int config_parse(const char *unit,
|
||||
/* Only log on request, except for ENOENT,
|
||||
* since we return 0 to the caller. */
|
||||
if ((flags & CONFIG_PARSE_WARN) || errno == ENOENT)
|
||||
log_full(errno == ENOENT ? LOG_DEBUG : LOG_ERR,
|
||||
"Failed to open configuration file '%s': %m", filename);
|
||||
log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno,
|
||||
"Failed to open configuration file '%s': %m", filename);
|
||||
return errno == ENOENT ? 0 : -errno;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -210,7 +210,7 @@ static int unit_file_find_dirs(
|
||||
|
||||
type = unit_name_to_type(name);
|
||||
if (type < 0) {
|
||||
log_error("Failed to to derive unit type from unit name: %m");
|
||||
log_error("Failed to to derive unit type from unit name: %s", name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user