mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
hurd: handle EINTR during critical sections
During critical sections, signal handling is deferred and thus RPCs return EINTR, even if SA_RESTART is set. We thus have to restart the whole critical section in that case. This also adds HURD_CRITICAL_UNLOCK in the cases where one wants to break the section in the middle.
This commit is contained in:
@@ -52,6 +52,7 @@ _hurd_socket_server (int domain, int dead)
|
||||
return MACH_PORT_NULL;
|
||||
}
|
||||
|
||||
retry:
|
||||
HURD_CRITICAL_BEGIN;
|
||||
__mutex_lock (&lock);
|
||||
|
||||
@@ -101,6 +102,9 @@ _hurd_socket_server (int domain, int dead)
|
||||
|
||||
__mutex_unlock (&lock);
|
||||
HURD_CRITICAL_END;
|
||||
if (server == MACH_PORT_NULL && errno == EINTR)
|
||||
/* Got a signal while inside an RPC of the critical section, retry again */
|
||||
goto retry;
|
||||
|
||||
return server;
|
||||
}
|
||||
|
Reference in New Issue
Block a user