summaryrefslogtreecommitdiff
path: root/libports
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-03-05 22:29:58 +0000
committerMiles Bader <miles@gnu.org>1996-03-05 22:29:58 +0000
commit0f878933c7003f5b8c081458f92f191d91d0cd12 (patch)
tree9454a63f87011b3d469e6415dee7ec7f2de3161a /libports
parentf427757544550cfe49d1f9e12f393773835e9bfa (diff)
(ports_get_right):
Check mach_port_request_notification for error returns, against all odds.
Diffstat (limited to 'libports')
-rw-r--r--libports/get-right.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libports/get-right.c b/libports/get-right.c
index 308123a3..0333b036 100644
--- a/libports/get-right.c
+++ b/libports/get-right.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.
@@ -21,6 +21,9 @@
#include "ports.h"
#include <cthreads.h>
#include <mach/notify.h>
+#include <assert.h>
+
+static volatile error_t gdb_loses = 0;
mach_port_t
ports_get_right (void *port)
@@ -41,10 +44,12 @@ ports_get_right (void *port)
{
pi->flags |= PORT_HAS_SENDRIGHTS;
pi->refcnt++;
- mach_port_request_notification (mach_task_self (), pi->port_right,
- MACH_NOTIFY_NO_SENDERS, 1,
- pi->port_right,
- MACH_MSG_TYPE_MAKE_SEND_ONCE, &foo);
+ gdb_loses =
+ mach_port_request_notification (mach_task_self (), pi->port_right,
+ MACH_NOTIFY_NO_SENDERS, 1,
+ pi->port_right,
+ MACH_MSG_TYPE_MAKE_SEND_ONCE, &foo);
+ assert_perror (gdb_loses);
if (foo != MACH_PORT_NULL)
mach_port_deallocate (mach_task_self (), foo);
}