platform: fix draining of the event queue with old libnl (rh #1180773)

It fails doesn't propagate EAGAIN properly. Fixed in 3.2.22's 375a629.

https://bugzilla.redhat.com/show_bug.cgi?id=1180773
This commit is contained in:
Lubomir Rintel
2015-01-12 17:03:59 +01:00
parent a687d1f9e0
commit 529591d8de

View File

@@ -4158,7 +4158,13 @@ event_handler (GIOChannel *channel,
* like to free up some space. We'll read in the status synchronously. */ * like to free up some space. We'll read in the status synchronously. */
nl_socket_modify_cb (priv->nlh_event, NL_CB_VALID, NL_CB_DEFAULT, NULL, NULL); nl_socket_modify_cb (priv->nlh_event, NL_CB_VALID, NL_CB_DEFAULT, NULL, NULL);
do { do {
errno = 0;
nle = nl_recvmsgs_default (priv->nlh_event); 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))
nle = -NLE_AGAIN;
} while (nle != -NLE_AGAIN); } while (nle != -NLE_AGAIN);
nl_socket_modify_cb (priv->nlh_event, NL_CB_VALID, NL_CB_CUSTOM, event_notification, user_data); nl_socket_modify_cb (priv->nlh_event, NL_CB_VALID, NL_CB_CUSTOM, event_notification, user_data);
cache_repopulate_all (platform); cache_repopulate_all (platform);