tree-wide: use error codes in xxx_from_string()
This commit is contained in:
@@ -874,7 +874,7 @@ int config_parse_log_facility(
|
||||
|
||||
x = log_facility_unshifted_from_string(rvalue);
|
||||
if (x < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0, "Failed to parse log facility, ignoring: %s", rvalue);
|
||||
log_syntax(unit, LOG_WARNING, filename, line, x, "Failed to parse log facility, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -904,7 +904,7 @@ int config_parse_log_level(
|
||||
|
||||
x = log_level_from_string(rvalue);
|
||||
if (x < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0, "Failed to parse log level, ignoring: %s", rvalue);
|
||||
log_syntax(unit, LOG_WARNING, filename, line, x, "Failed to parse log level, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -937,7 +937,7 @@ int config_parse_signal(
|
||||
|
||||
r = signal_from_string(rvalue);
|
||||
if (r <= 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0, "Failed to parse signal name, ignoring: %s", rvalue);
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse signal name, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1092,7 +1092,7 @@ int config_parse_advertise(const char *unit,
|
||||
/* We reuse the kernel provided enum which does not contain negative value. So, the cast
|
||||
* below is mandatory. Otherwise, the check below always passes and access an invalid address. */
|
||||
if ((int) mode < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0,
|
||||
log_syntax(unit, LOG_WARNING, filename, line, mode,
|
||||
"Failed to parse advertise mode, ignoring: %s", w);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user