tg-eintr
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Tue, 27 May 2025 10:40:04 +0000 (11:40 +0100)
committerSean Whitton <spwhitton@spwhitton.name>
Tue, 27 May 2025 10:40:04 +0000 (11:40 +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 f77c83ee9e5d8113ba47340abdb16510f441920a..6c39f37041f8a9b77b70c0968ddb5ef9ab4c7472 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