summaryrefslogtreecommitdiff
path: root/libports/inhibit-all-rpcs.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2000-07-25 22:34:00 +0000
committerMark Kettenis <kettenis@gnu.org>2000-07-25 22:34:00 +0000
commit317f76798849bac85c692c76475a85be0f592dab (patch)
treef09c11fd774304e88b76666753c3379c44a0c97a /libports/inhibit-all-rpcs.c
parent3296b371bab2a87359323a405ed1fa51a00397c9 (diff)
* inhibit-all-rpcs.c (ports_inhibit_all_rpcs): Avoid calling
hurd_thread_cancel on the current thread. * inhibit-class-rpcs.c (ports_inhibit_class_rpcs): Likewise. * inhibit-bucket-rpcs.c (ports_inhibit_bucket_rpcs): Likewise. * inhibit-port-rpcs.c (ports_inhibit_port_rpcs): Likewise.
Diffstat (limited to 'libports/inhibit-all-rpcs.c')
-rw-r--r--libports/inhibit-all-rpcs.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libports/inhibit-all-rpcs.c b/libports/inhibit-all-rpcs.c
index 13aa62c6..9efb3c2f 100644
--- a/libports/inhibit-all-rpcs.c
+++ b/libports/inhibit-all-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.
@@ -42,8 +42,15 @@ ports_inhibit_all_rpcs ()
struct port_info *pi = portstruct;
for (rpc = pi->current_rpcs; rpc; rpc = rpc->next)
- if (hurd_thread_cancel (rpc->thread) == EINTR)
- this_one = 1;
+ {
+ /* Avoid cancelling the calling thread if it's currently
+ handling a RPC. */
+ if (rpc->thread == hurd_thread_self ())
+ this_one = 1;
+ else
+ hurd_thread_cancel (rpc->thread);
+ }
+
return 0;
}
@@ -70,5 +77,3 @@ ports_inhibit_all_rpcs ()
return err;
}
-
-