mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-30 13:24:48 +00:00
shared: fix nm_errno_from_native() for negative values
We first need to map negative values to their positive form,
and then do the check for the reserved range.
Fixes: 18732c3493
This commit is contained in:
parent
047998f80a
commit
89d3c5242b
|
@ -118,9 +118,9 @@ nm_errno_from_native (int errsv)
|
|||
* are coerced to the special value NME_NATIVE_ERRNO, as they cannot
|
||||
* otherwise be represented in nm-error number domain. */
|
||||
if (errsv < 0) {
|
||||
return G_UNLIKELY (errsv == G_MININT)
|
||||
? NME_NATIVE_ERRNO
|
||||
: -errsv;
|
||||
if (G_UNLIKELY (errsv == G_MININT))
|
||||
return NME_NATIVE_ERRNO;
|
||||
errsv = -errsv;
|
||||
}
|
||||
return G_UNLIKELY ( errsv >= _NM_ERRNO_RESERVED_FIRST
|
||||
&& errsv <= _NM_ERRNO_RESERVED_LAST)
|
||||
|
|
Loading…
Reference in a new issue