From 0f878933c7003f5b8c081458f92f191d91d0cd12 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 5 Mar 1996 22:29:58 +0000 Subject: (ports_get_right): Check mach_port_request_notification for error returns, against all odds. --- libports/get-right.c | 15 ++++++++++----- 1 file 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 #include +#include + +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); } -- cgit v1.2.3