Blame SOURCES/audit-2.6.5-autrace.patch

c672a9
diff -urp audit-2.6.5.orig/src/autrace.c audit-2.6.5/src/autrace.c
c672a9
--- audit-2.6.5.orig/src/autrace.c	2016-07-13 12:14:36.000000000 -0400
c672a9
+++ audit-2.6.5/src/autrace.c	2016-07-22 10:41:41.221461110 -0400
c672a9
@@ -298,18 +298,19 @@ static int count_em(int fd)
c672a9
 	FD_SET(fd, &read_mask);
c672a9
 
c672a9
 	for (i = 0; i < timeout; i++) {
c672a9
+		struct timeval t;
c672a9
+
c672a9
+		t.tv_sec  = 0;
c672a9
+		t.tv_usec = 100000; /* .1 second */
c672a9
 		retval = audit_get_reply(fd, &rep, GET_REPLY_NONBLOCKING, 0);
c672a9
 		if (retval > 0) {
c672a9
-			struct timeval t;
c672a9
-
c672a9
 			if (rep.type == NLMSG_ERROR && 
c672a9
 					rep.error->error == 0)
c672a9
 				continue;
c672a9
-			t.tv_sec  = 0;
c672a9
-			t.tv_usec = 100000; /* .1 second */
c672a9
 			do {
c672a9
 				retval=select(fd+1, &read_mask, NULL, NULL, &t);
c672a9
 			} while (retval < 0 && errno == EINTR);
c672a9
+
c672a9
 			switch (rep.type)
c672a9
 			{
c672a9
 				case NLMSG_DONE:
c672a9
@@ -323,7 +324,8 @@ static int count_em(int fd)
c672a9
 				default:
c672a9
 					break;
c672a9
 			}
c672a9
-		}
c672a9
+		} else if (errno == EAGAIN)  // Take short delay
c672a9
+			retval = select(fd+1, &read_mask, NULL, NULL, &t);
c672a9
 	}
c672a9
 	if (i >= timeout && count == 0)
c672a9
 		count = -1;