From 3538ecac80377f828c6bba504e468201ea7ea55b Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 29 Mar 1996 14:34:56 +0000 Subject: (ports_transfer_right): --- libports/transfer-right.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libports') diff --git a/libports/transfer-right.c b/libports/transfer-right.c index bce54916..d5844ea2 100644 --- a/libports/transfer-right.c +++ b/libports/transfer-right.c @@ -32,7 +32,8 @@ ports_transfer_right (void *tostruct, int dereffrompi = 0; int dereftopi = 0; int hassendrights = 0; - + error_t err; + mutex_lock (&_ports_lock); /* Fetch the port in FROMPI and clear its use */ @@ -57,7 +58,7 @@ ports_transfer_right (void *tostruct, MACH_PORT_RIGHT_RECEIVE, -1); if ((topi->flags & PORT_HAS_SENDRIGHTS) && !hassendrights) { - derreftopi = 1; + dereftopi = 1; topi->flags &= ~PORT_HAS_SENDRIGHTS; } else if (((topi->flags & PORT_HAS_SENDRIGHTS) == 0) && hassendrights) @@ -82,10 +83,11 @@ ports_transfer_right (void *tostruct, mutex_unlock (&_ports_lock); /* Take care of any lowered reference counts. */ - if (derreffrompi) + if (dereffrompi) ports_port_deref (frompi); - if (derreftopi) + if (dereftopi) ports_port_deref (topi); + return 0; } -- cgit v1.2.3