tg-eintr
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Tue, 5 May 2020 18:12:38 +0000 (19:12 +0100)
committerAurelien Jarno <aurel32@debian.org>
Tue, 5 May 2020 18:12:38 +0000 (19:12 +0100)
commit 230b85f414291ac955827aba15cfbd103ab6ebdd
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu Jun 9 01:15:10 2016 +0200

    Fix pipe() call returning EINTR sometimes

    because it uses a critical section

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name tg-eintr.diff

hurd/hurdsock.c

index ab74a521ec6ae7d0e3956eef3eb5962f94db33ec..0f0b2e17142ac8fafaa68e074d8b3d09806caa3e 100644 (file)
@@ -52,6 +52,7 @@ _hurd_socket_server (int domain, int dead)
       return MACH_PORT_NULL;
     }
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&lock);
 
@@ -102,6 +103,10 @@ _hurd_socket_server (int domain, int dead)
   __mutex_unlock (&lock);
   HURD_CRITICAL_END;
 
+  if (!server && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry again */
+    goto retry;
+
   return server;
 }
 \f