platform: refactor check for error in event_handler_recvmsgs() to switch statement
This commit is contained in:
@@ -5530,13 +5530,17 @@ continue_reading:
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
n = nl_recv (sk, &nla, &buf, &creds);
|
n = nl_recv (sk, &nla, &buf, &creds);
|
||||||
|
|
||||||
|
switch (n) {
|
||||||
|
case 0:
|
||||||
/* Work around a libnl bug fixed in 3.2.22 (375a6294) */
|
/* Work around a libnl bug fixed in 3.2.22 (375a6294) */
|
||||||
if (n == 0 && errno == EAGAIN) {
|
if (errno == EAGAIN) {
|
||||||
/* EAGAIN is equal to EWOULDBLOCK. If it would not be, we'd have to
|
/* EAGAIN is equal to EWOULDBLOCK. If it would not be, we'd have to
|
||||||
* workaround libnl3 mapping EWOULDBLOCK to -NLE_FAILURE. */
|
* workaround libnl3 mapping EWOULDBLOCK to -NLE_FAILURE. */
|
||||||
G_STATIC_ASSERT (EAGAIN == EWOULDBLOCK);
|
G_STATIC_ASSERT (EAGAIN == EWOULDBLOCK);
|
||||||
n = -NLE_AGAIN;
|
n = -NLE_AGAIN;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
return n;
|
return n;
|
||||||
|
Reference in New Issue
Block a user