mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 11:10:09 +01:00
platform: EAGAIN is equal to EWOULDBLOCK
The macro EWOULDBLOCK is another name for EAGAIN; they are always the
same in the GNU C Library.
https://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Error-Codes.html
Otherwise, we would need a workaround for EWOULDBLOCK too, because
libnl maps that to NLE_FAILURE. So we would have to detect EAGAIN
as (nle == -NLE_FAILURE && errno == EWOULDBLOCK).
(cherry picked from commit d2fab2df54)
This commit is contained in:
parent
df4e535752
commit
feaa4e5b9a
1 changed files with 5 additions and 1 deletions
|
|
@ -4582,8 +4582,12 @@ event_handler_read_netlink_one (NMPlatform *platform)
|
|||
nle = nl_recvmsgs_default (priv->nlh_event);
|
||||
|
||||
/* Work around a libnl bug fixed in 3.2.22 (375a6294) */
|
||||
if (nle == 0 && (errno == EAGAIN || errno == EWOULDBLOCK))
|
||||
if (nle == 0 && errno == EAGAIN) {
|
||||
/* EAGAIN is equal to EWOULDBLOCK. If it would not be, we'd have to
|
||||
* workaround libnl3 mapping EWOULDBLOCK to -NLE_FAILURE. */
|
||||
G_STATIC_ASSERT (EAGAIN == EWOULDBLOCK);
|
||||
nle = -NLE_AGAIN;
|
||||
}
|
||||
|
||||
if (nle < 0)
|
||||
switch (nle) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue