summaryrefslogtreecommitdiff
path: root/libports/get-right.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-21 22:25:42 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-21 22:25:42 +0000
commitaf10bf5e427df592f54362ca1047c5d1ca3e200d (patch)
tree43e49c9ca65db9869db3554527ee7aad6b9fadbf /libports/get-right.c
parent9cd6b737c3397706b075fd3258bd11ebdf8fb880 (diff)
(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).
Diffstat (limited to 'libports/get-right.c')
-rw-r--r--libports/get-right.c8
1 files changed, 7 insertions, 1 deletions
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)
{