File 0001-rendezvous_request-fix-endless-loop-in-EMFILE-case.patch of Package libtirpc.8064

From 64967e9d8ef880ea936d60e7f486f5142812b4c8 Mon Sep 17 00:00:00 2001
From: Steve Dickson <steved@redhat.com>
Date: Thu, 3 Mar 2016 14:31:08 -0500
Subject: [PATCH] rendezvous_request: fix endless loop in EMFILE case

With the port to poll, and endless loop can be created
when we run out of file descriptors. Remove the code
that tries to recover from that error

Signed-off-by: Steve Dickson <steved@redhat.com>
(cherry picked from commit fce98161d9815ea016855d9f00274276452c2c4b)
---
 src/svc_vc.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/svc_vc.c b/src/svc_vc.c
index 6ae613d..481907f 100644
--- a/src/svc_vc.c
+++ b/src/svc_vc.c
@@ -338,22 +338,10 @@ rendezvous_request(xprt, msg)
 	r = (struct cf_rendezvous *)xprt->xp_p1;
 again:
 	len = sizeof addr;
-	if ((sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr,
-	    &len)) < 0) {
+	sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr, &len);
+	if (sock < 0) {
 		if (errno == EINTR)
 			goto again;
-
-		if (errno == EMFILE || errno == ENFILE) {
-		  /* If there are no file descriptors available, then accept will fail.
-		     We want to delay here so the connection request can be dequeued;
-		     otherwise we can bounce between polling and accepting, never
-		     giving the request a chance to dequeue and eating an enormous
-		     amount of cpu time in svc_run if we're polling on many file
-		     descriptors.  */
-		        struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
-                        nanosleep (&ts, NULL);
-			goto again;
-		}
 		return (FALSE);
 	}
 	/*
-- 
2.16.4