From d7bc26b053598cf8556b16c2470f5934e0ffb5a8 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 29 Jan 1996 20:32:50 +0000 Subject: (fshelp_set_active): Deal correctly with the case where a passive translator is being started. --- libfshelp/set-active.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libfshelp/set-active.c b/libfshelp/set-active.c index b2f49cf4..f2cc297b 100644 --- a/libfshelp/set-active.c +++ b/libfshelp/set-active.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. Written by Michael I. Bushnell. This file is part of the GNU Hurd. @@ -26,9 +26,20 @@ fshelp_set_active (struct transbox *box, mach_port_t active, int excl) { - if (excl && box->active != MACH_PORT_NULL) + int cancel; + + if (excl + && ((box->active != MACH_PORT_NULL) || (box->flags & TRANSBOX_STARTING))) return EBUSY; + while (box->flags & TRANSBOX_STARTING) + { + box->flags |= TRANSBOX_WANTED; + cancel = hurd_condition_wait (&box->wakeup, box->lock); + if (cancel) + return EINTR; + } + if (box->active != MACH_PORT_NULL) mach_port_deallocate (mach_task_self (), box->active); -- cgit v1.2.3