tg-eintr
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Mon, 16 Jan 2017 17:43:37 +0000 (17:43 +0000)
committerAurelien Jarno <aurel32@debian.org>
Mon, 16 Jan 2017 17:43:37 +0000 (17:43 +0000)
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 1aaec27acd43d47f57c224cd2c903333886ef63c..03d45e78a11b79b3761c5733a577d268394b87fe 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