tree-wide: use error codes in xxx_from_string()

This commit is contained in:
Yu Watanabe
2021-02-12 01:17:13 +09:00
parent 0cbb768aba
commit b98680b2b8
12 changed files with 36 additions and 29 deletions
+1 -1
View File
@@ -577,7 +577,7 @@ int config_parse_l2tp_session_l2spec(
spec = l2tp_l2spec_type_from_string(rvalue);
if (spec < 0) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
log_syntax(unit, LOG_WARNING, filename, line, spec,
"Failed to parse layer2 specific header type. Ignoring assignment: %s", rvalue);
return 0;
}
+1 -1
View File
@@ -139,7 +139,7 @@ int config_parse_netdev_kind(
k = netdev_kind_from_string(rvalue);
if (k < 0) {
log_syntax(unit, LOG_WARNING, filename, line, 0, "Failed to parse netdev kind, ignoring assignment: %s", rvalue);
log_syntax(unit, LOG_WARNING, filename, line, k, "Failed to parse netdev kind, ignoring assignment: %s", rvalue);
return 0;
}
+2 -1
View File
@@ -581,7 +581,8 @@ int config_parse_tunnel_key(const char *unit,
if (r < 0) {
r = safe_atou32(rvalue, &k);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, 0, "Failed to parse tunnel key ignoring assignment: %s", rvalue);
log_syntax(unit, LOG_WARNING, filename, line, r,
"Failed to parse tunnel key ignoring assignment: %s", rvalue);
return 0;
}
} else