aboutsummaryrefslogtreecommitdiff
path: root/hurd/hurdsig.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-04-24 03:28:51 +0000
committerMiles Bader <miles@gnu.org>1996-04-24 03:28:51 +0000
commite0637da1c74bfbf640e049329c955267b4922c19 (patch)
tree6e21823b686024feb05be4aea1c480db061df415 /hurd/hurdsig.c
parent9a8c0d4f41ebee0829fb4cf137c3c294cf88675b (diff)
downloadglibc-e0637da1c74bfbf640e049329c955267b4922c19.tar
glibc-e0637da1c74bfbf640e049329c955267b4922c19.tar.gz
glibc-e0637da1c74bfbf640e049329c955267b4922c19.tar.bz2
glibc-e0637da1c74bfbf640e049329c955267b4922c19.zip
(signal_allowed): For SIGIO/SIGURG, add a new variable, LUCKY, to use instead of setting D to -1 (which fucks things up).
Diffstat (limited to 'hurd/hurdsig.c')
-rw-r--r--hurd/hurdsig.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 6085ab14cf..3ba54290fe 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -1013,8 +1013,9 @@ signal_allowed (int signo, mach_port_t refport)
authorizing SIGIO and SIGURG signals properly. */
int d;
+ int lucky = 0; /* True if we find a match for REFPORT. */
__mutex_lock (&_hurd_dtable_lock);
- for (d = 0; (unsigned int) d < (unsigned int) _hurd_dtablesize; ++d)
+ for (d = 0; !lucky && (unsigned) d < (unsigned) _hurd_dtablesize; ++d)
{
struct hurd_userlink ulink;
io_t port;
@@ -1026,13 +1027,13 @@ signal_allowed (int signo, mach_port_t refport)
{
if (refport == asyncid)
/* Break out of the loop on the next iteration. */
- d = -1;
+ lucky = 1;
__mach_port_deallocate (__mach_task_self (), asyncid);
}
_hurd_port_free (&_hurd_dtable[d]->port, &ulink, port);
}
/* If we found a lucky winner, we've set D to -1 in the loop. */
- if (d < 0)
+ if (lucky)
goto win;
}
}