From af10bf5e427df592f54362ca1047c5d1ca3e200d Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 21 Jul 1995 22:25:42 +0000 Subject: (ports_get_right): If the right is null (because we are closing down), then just return null. (This helps in a race in ufs/ex2fs). --- libports/get-right.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libports') diff --git a/libports/get-right.c b/libports/get-right.c index dd7f5b6a..308123a3 100644 --- a/libports/get-right.c +++ b/libports/get-right.c @@ -29,7 +29,13 @@ ports_get_right (void *port) mach_port_t foo; mutex_lock (&_ports_lock); - + + if (pi->port_right == MACH_PORT_NULL) + { + mutex_unlock (&_ports_lock); + return MACH_PORT_NULL; + } + pi->mscount++; if ((pi->flags & PORT_HAS_SENDRIGHTS) == 0) { -- cgit v1.2.3