From 5b423a6848038a829658fe6e4753d1e5c8743cb3 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 31 Mar 2001 23:06:37 +0000 Subject: 2001-03-29 Neal H Walfield * reallocate-port.c (ports_reallocate_port): Assert return from mach_port_move_member. * transfer-right.c (ports_transfer_right): Likewise. --- libports/reallocate-port.c | 7 ++++--- libports/transfer-right.c | 8 +++++++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'libports') diff --git a/libports/reallocate-port.c b/libports/reallocate-port.c index 35dd4883..bd1b1893 100644 --- a/libports/reallocate-port.c +++ b/libports/reallocate-port.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc. Written by Michael I. Bushnell. This file is part of the GNU Hurd. @@ -52,8 +52,9 @@ ports_reallocate_port (void *portstruct) ihash_add (pi->bucket->htable, pi->port_right, pi, &pi->hentry); mutex_unlock (&_ports_lock); - mach_port_move_member (mach_task_self (), pi->port_right, - pi->bucket->portset); + err = mach_port_move_member (mach_task_self (), pi->port_right, + pi->bucket->portset); + assert_perror (err); if (dropref) ports_port_deref (pi); diff --git a/libports/transfer-right.c b/libports/transfer-right.c index d5844ea2..45a6cc52 100644 --- a/libports/transfer-right.c +++ b/libports/transfer-right.c @@ -20,6 +20,7 @@ #include "ports.h" +#include #include error_t @@ -56,6 +57,7 @@ ports_transfer_right (void *tostruct, ihash_locp_remove (topi->bucket->htable, topi->hentry); err = mach_port_mod_refs (mach_task_self (), topi->port_right, MACH_PORT_RIGHT_RECEIVE, -1); + assert_perror (err); if ((topi->flags & PORT_HAS_SENDRIGHTS) && !hassendrights) { dereftopi = 1; @@ -77,7 +79,11 @@ ports_transfer_right (void *tostruct, { ihash_add (topi->bucket->htable, port, topi, &topi->hentry); if (topi->bucket != frompi->bucket) - mach_port_move_member (mach_task_self (), port, topi->bucket->portset); + { + err = mach_port_move_member (mach_task_self (), port, + topi->bucket->portset); + assert_perror (err); + } } mutex_unlock (&_ports_lock); -- cgit v1.2.3