aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bushnell, BSG <thomas@gnu.org>1996-10-08 18:38:34 +0000
committerThomas Bushnell, BSG <thomas@gnu.org>1996-10-08 18:38:34 +0000
commit6428aed93c1a132c4cd6a8c21de9d0248fed4c46 (patch)
treea9ae9cfb5747ef3ccb0484cc1b06a92439ed1b96 /hurd/ports-get.c
parent*** empty log message *** (diff)
downloadglibc-6428aed93c1a132c4cd6a8c21de9d0248fed4c46.tar.gz
glibc-6428aed93c1a132c4cd6a8c21de9d0248fed4c46.tar.bz2
glibc-6428aed93c1a132c4cd6a8c21de9d0248fed4c46.zip
Tue Oct 8 13:58:31 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* hurd/ports-get.c (_hurd_ports_get): If the requested port is null, don't attempt mach_port_mod_refs.
Diffstat (limited to 'hurd/ports-get.c')
-rw-r--r--hurd/ports-get.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hurd/ports-get.c b/hurd/ports-get.c
index e45494ac91..cdbeacc36d 100644
--- a/hurd/ports-get.c
+++ b/hurd/ports-get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,9 +38,9 @@ _hurd_ports_get (unsigned int which, mach_port_t *result)
return EINVAL;
if (which >= INIT_PORT_MAX || _hurd_ports_getters[which] == NULL)
return HURD_PORT_USE (&_hurd_ports[which],
- __mach_port_mod_refs (__mach_task_self (),
- (*result = port),
- MACH_PORT_RIGHT_SEND,
- +1));
+ (*result = port) == MACH_PORT_NULL ? 0
+ : __mach_port_mod_refs (__mach_task_self (),
+ port, MACH_PORT_RIGHT_SEND,
+ +1));
return (*_hurd_ports_getters[which]) (result);
}