mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 02:20:12 +01: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) {
|
||||
/* don't touch out_value. The caller is supposed
|
||||
* to initialize it with the default value. */
|
||||
errno = ENOENT;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1339,10 +1340,12 @@ svGetValueEnum(shvarFile *s, const char *key, GType gtype, int *out_value, GErro
|
|||
err_token,
|
||||
svalue,
|
||||
key);
|
||||
errno = EINVAL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
NM_SET_OUT(out_value, value);
|
||||
errno = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue