summaryrefslogtreecommitdiff
path: root/libports/get-right.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-03-17 09:53:10 +0000
committerRoland McGrath <roland@gnu.org>2000-03-17 09:53:10 +0000
commitde4a4611908a0c59f03b2b04d893dad5b69b3782 (patch)
tree494fb822da64ffd033244c1f53a24896fa62e7d6 /libports/get-right.c
parent605a7031c14e501b7ad995dd9eb67ee1ee171ad3 (diff)
2000-03-17 Roland McGrath <roland@baalperazim.frob.com>
* get-right.c (gdb_loses): Remove global variable. (ports_get_right): Use a local instead.
Diffstat (limited to 'libports/get-right.c')
-rw-r--r--libports/get-right.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/libports/get-right.c b/libports/get-right.c
index 0c5f13b7..95662f58 100644
--- a/libports/get-right.c
+++ b/libports/get-right.c
@@ -1,5 +1,5 @@
-/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+/*
+ Copyright (C) 1995,96,2000 Free Software Foundation, Inc.
Written by Michael I. Bushnell.
This file is part of the GNU Hurd.
@@ -23,14 +23,13 @@
#include <mach/notify.h>
#include <assert.h>
-static volatile error_t gdb_loses = 0;
-
mach_port_t
ports_get_right (void *port)
{
struct port_info *pi = port;
mach_port_t foo;
-
+ error_t err;
+
mutex_lock (&_ports_lock);
if (pi->port_right == MACH_PORT_NULL)
@@ -38,23 +37,23 @@ ports_get_right (void *port)
mutex_unlock (&_ports_lock);
return MACH_PORT_NULL;
}
-
+
pi->mscount++;
if ((pi->flags & PORT_HAS_SENDRIGHTS) == 0)
{
pi->flags |= PORT_HAS_SENDRIGHTS;
pi->refcnt++;
- gdb_loses =
- mach_port_request_notification (mach_task_self (), pi->port_right,
- MACH_NOTIFY_NO_SENDERS, pi->mscount,
- pi->port_right,
- MACH_MSG_TYPE_MAKE_SEND_ONCE, &foo);
- assert_perror (gdb_loses);
+ err = mach_port_request_notification (mach_task_self (),
+ pi->port_right,
+ MACH_NOTIFY_NO_SENDERS,
+ pi->mscount,
+ pi->port_right,
+ MACH_MSG_TYPE_MAKE_SEND_ONCE,
+ &foo);
+ assert_perror (err);
if (foo != MACH_PORT_NULL)
mach_port_deallocate (mach_task_self (), foo);
}
mutex_unlock (&_ports_lock);
return pi->port_right;
}
-
-