avc_netlink_recieve should continue to poll if it receinves an EINTR rather

This commit is contained in:
Dan Walsh 2012-02-03 10:31:53 -05:00
parent 86fcde8ff1
commit 76fb5c8e65
2 changed files with 19 additions and 1 deletions

View File

@ -264,6 +264,21 @@ index 1ddddb0..985842d 100644
override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(EMFLAGS)
RANLIB=ranlib
diff --git a/libselinux/src/avc_internal.c b/libselinux/src/avc_internal.c
index be4c0a3..a07aa7f 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;
diff --git a/libselinux/src/avc_internal.h b/libselinux/src/avc_internal.h
index 53610e8..f851659 100644
--- a/libselinux/src/avc_internal.h

View File

@ -7,7 +7,7 @@
Summary: SELinux library and simple utilities
Name: libselinux
Version: 2.1.9
Release: 5%{?dist}
Release: 6%{?dist}
License: Public Domain
Group: System Environment/Libraries
Source: %{name}-%{version}.tgz
@ -232,6 +232,9 @@ rm -rf %{buildroot}
%{ruby_sitearch}/selinux.so
%changelog
* Fri Feb 3 2012 Dan Walsh <dwalsh@redhat.com> - 2.1.9-6
- avc_netlink_recieve should continue to poll if it receinves an EINTR rather
* Fri Jan 27 2012 Dan Walsh <dwalsh@redhat.com> - 2.1.9-5
- Rebuild with cleaned up upstream to work in /usr