summary refs log tree commit diff
path: root/sunrpc/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/svc.c')
-rw-r--r--sunrpc/svc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index 917e9a311c..3ed6cee09e 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -545,6 +545,13 @@ svc_getreq_common (const int fd)
 }
 libc_hidden_nolink_sunrpc (svc_getreq_common, GLIBC_2_2)
 
+void
+__svc_wait_on_error (void)
+{
+  struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+  __nanosleep (&ts, NULL);
+}
+
 /* 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
@@ -555,8 +562,7 @@ __svc_accept_failed (void)
 {
   if (errno == EMFILE)
     {
-      struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
-      __nanosleep (&ts, NULL);
+      __svc_wait_on_error ();
     }
 }