]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - hurd/hurdfchdir.c
posix/glob.c: update from gnulib
[thirdparty/glibc.git] / hurd / hurdfchdir.c
index 66ed23ece1918ec11a1c20c134893caa580af2b9..554eea5002028a7b0874c658c46ac56c0be5c53d 100644 (file)
@@ -1,5 +1,5 @@
 /* Change a port cell to a directory in an open file descriptor.
-   Copyright (C) 1999-2013 Free Software Foundation, Inc.
+   Copyright (C) 1999-2022 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
 #include <unistd.h>
@@ -32,6 +32,7 @@ _hurd_change_directory_port_from_fd (struct hurd_port *portcell, int fd)
   if (!d)
     return __hurd_fail (EBADF);
 
+retry:
   HURD_CRITICAL_BEGIN;
 
   ret = HURD_PORT_USE (&d->port,
@@ -53,6 +54,9 @@ _hurd_change_directory_port_from_fd (struct hurd_port *portcell, int fd)
                       }));
 
   HURD_CRITICAL_END;
+  if (ret == -1 && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry again */
+    goto retry;
 
   return ret;
 }