mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 14:48:10 +02:00
ifcfg: set errno for svGetValueEnum() to detect unset values
This commit is contained in:
parent
8c6d89f937
commit
fb2b35b068
1 changed files with 3 additions and 0 deletions
|
|
@ -1328,6 +1328,7 @@ svGetValueEnum(shvarFile *s, const char *key, GType gtype, int *out_value, GErro
|
||||||
if (!svalue) {
|
if (!svalue) {
|
||||||
/* don't touch out_value. The caller is supposed
|
/* don't touch out_value. The caller is supposed
|
||||||
* to initialize it with the default value. */
|
* to initialize it with the default value. */
|
||||||
|
errno = ENOENT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1339,10 +1340,12 @@ svGetValueEnum(shvarFile *s, const char *key, GType gtype, int *out_value, GErro
|
||||||
err_token,
|
err_token,
|
||||||
svalue,
|
svalue,
|
||||||
key);
|
key);
|
||||||
|
errno = EINVAL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NM_SET_OUT(out_value, value);
|
NM_SET_OUT(out_value, value);
|
||||||
|
errno = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue