mirror of
https://github.com/SELinuxProject/selinux
synced 2025-03-01 07:50:38 +00:00
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:
parent
2ca19f3f67
commit
378dfe4d6a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user