libselinux: avc_netlink_recieve handle EINTR

should continue to poll if it receinves an EINTR rather then exiting with an error.

This was a major bug within dbus that was causing dbus to crash it was
discussed at the time whether this is a dbus bug or an libselinux bug,
it was decided that we should fix it within libselinux.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Dan Walsh 2012-02-03 10:22:26 -05:00 committed by Eric Paris
parent 2ca19f3f67
commit 378dfe4d6a

View File

@ -101,7 +101,9 @@ static int avc_netlink_receive(char *buf, unsigned buflen, int blocking)
socklen_t nladdrlen = sizeof nladdr;
struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
rc = poll(&pfd, 1, (blocking ? -1 : 0));
do {
rc = poll(&pfd, 1, (blocking ? -1 : 0));
} while (rc < 0 && errno == EINTR);
if (rc == 0 && !blocking) {
errno = EWOULDBLOCK;