Blob Blame Raw
diff -rup a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
--- a/sunrpc/svc_tcp.c	2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_tcp.c	2012-06-05 11:30:09.948733571 -0600
@@ -44,6 +44,7 @@
 #include <sys/poll.h>
 #include <errno.h>
 #include <stdlib.h>
+#include <time.h>
 
 #include <wchar.h>
 #include <libio/iolibio.h>
@@ -247,6 +248,11 @@ again:
     {
       if (errno == EINTR)
 	goto again;
+      if (errno == EMFILE)
+        {
+          struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+          __nanosleep(&ts , NULL);
+        }
       return FALSE;
     }
   /*
diff -rup a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
--- a/sunrpc/svc_udp.c	2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_udp.c	2012-06-05 11:30:09.948733571 -0600
@@ -40,6 +40,7 @@
 #include <sys/socket.h>
 #include <errno.h>
 #include <libintl.h>
+#include <time.h>
 
 #ifdef IP_PKTINFO
 #include <sys/uio.h>
@@ -277,8 +278,16 @@ again:
 		       (int) su->su_iosz, 0,
 		       (struct sockaddr *) &(xprt->xp_raddr), &len);
   xprt->xp_addrlen = len;
-  if (rlen == -1 && errno == EINTR)
-    goto again;
+  if (rlen == -1)
+    {
+      if (errno == EINTR)
+        goto again;
+      if (errno == EMFILE)
+        {
+          struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+          __nanosleep(&ts , NULL);
+        }
+    }
   if (rlen < 16)		/* < 4 32-bit ints? */
     return FALSE;
   xdrs->x_op = XDR_DECODE;
diff -rup a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
--- a/sunrpc/svc_unix.c	2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_unix.c	2012-06-05 11:30:36.495612770 -0600
@@ -46,6 +46,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <libintl.h>
+#include <time.h>
 #include <wchar.h>
 
 /*
@@ -244,6 +245,11 @@ again:
     {
       if (errno == EINTR)
 	goto again;
+      if (errno == EMFILE)
+        {
+          struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+          __nanosleep(&ts , NULL);
+        }
       return FALSE;
     }
   /*