From 378dfe4d6ab7c007013d8534d2bc902dd6c29833 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Fri, 3 Feb 2012 10:22:26 -0500 Subject: [PATCH] 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 Acked-by: Dan Walsh --- libselinux/src/avc_internal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libselinux/src/avc_internal.c b/libselinux/src/avc_internal.c index be4c0a3c..a07aa7fb 100644 --- a/libselinux/src/avc_internal.c +++ b/libselinux/src/avc_internal.c @@ -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;