From 041baa808e57756636411879af8a0a8801680884 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 20 Dec 2009 15:32:10 +0100 Subject: Fix spurious authenticate EINTR * auth/auth.c (S_auth_user_authenticate): Do not return EINTR if user is not pending any more, i.e. server actually already answered. (S_auth_server_authenticate): Do not return EINTR if server is not pending any more, i.e. user actually already answered. --- auth/auth.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/auth/auth.c b/auth/auth.c index fd7c018f..239b4fb3 100644 --- a/auth/auth.c +++ b/auth/auth.c @@ -327,7 +327,8 @@ S_auth_user_authenticate (struct authhandle *userauth, u.user = userauth; condition_init (&u.wakeup); ports_interrupt_self_on_port_death (userauth, rendezvous); - if (hurd_condition_wait (&u.wakeup, &pending_lock)) + if (hurd_condition_wait (&u.wakeup, &pending_lock) + && hurd_ihash_find (&pending_users, rendezvous)) /* We were interrupted; remove our record. */ { hurd_ihash_locp_remove (&pending_users, u.locp); @@ -408,7 +409,8 @@ S_auth_server_authenticate (struct authhandle *serverauth, s.passthrough = newport; condition_init (&s.wakeup); ports_interrupt_self_on_port_death (serverauth, rendezvous); - if (hurd_condition_wait (&s.wakeup, &pending_lock)) + if (hurd_condition_wait (&s.wakeup, &pending_lock) + && hurd_ihash_find (&pending_servers, rendezvous)) /* We were interrupted; remove our record. */ { hurd_ihash_locp_remove (&pending_servers, s.locp); -- cgit v1.2.3