diff options
Diffstat (limited to 'libports/inhibit-bucket-rpcs.c')
-rw-r--r-- | libports/inhibit-bucket-rpcs.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libports/inhibit-bucket-rpcs.c b/libports/inhibit-bucket-rpcs.c index a04906ff..7fc55d31 100644 --- a/libports/inhibit-bucket-rpcs.c +++ b/libports/inhibit-bucket-rpcs.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc. Written by Michael I. Bushnell. This file is part of the GNU Hurd. @@ -35,18 +35,22 @@ ports_inhibit_bucket_rpcs (struct port_bucket *bucket) else { int this_one = 0; - error_t interruptor (void *portstruct) + + HURD_IHASH_ITERATE (&bucket->htable, portstruct) { struct rpc_info *rpc; struct port_info *pi = portstruct; for (rpc = pi->current_rpcs; rpc; rpc = rpc->next) - if (hurd_thread_cancel (rpc->thread) == EINTR) - this_one = 1; - return 0; + { + /* Avoid cancelling the calling thread. */ + if (rpc->thread == hurd_thread_self ()) + this_one = 1; + else + hurd_thread_cancel (rpc->thread); + } } - ihash_iterate (bucket->htable, interruptor); while (bucket->rpcs > this_one) { |