summaryrefslogtreecommitdiff
path: root/libports
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2010-10-28 23:50:13 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-10-28 23:50:13 +0200
commit0b6286a3c5eb86e3cca72d0840fc009855e4fba5 (patch)
tree2c87ca1e4d1ffe44a1c042eefc25ed7c44550803 /libports
parentda6e015fb95689de06f861119a32939b1db7b2b9 (diff)
Fix _ports_lock usage
* libports/create-internal.c (_ports_create_port_internal): Add label after mutex_unlock(_ports_lock), use it where appropriate.
Diffstat (limited to 'libports')
-rw-r--r--libports/create-internal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libports/create-internal.c b/libports/create-internal.c
index 5db71129..7a9b1cb0 100644
--- a/libports/create-internal.c
+++ b/libports/create-internal.c
@@ -100,7 +100,7 @@ _ports_create_port_internal (struct port_class *class,
err = mach_port_move_member (mach_task_self (), pi->port_right,
bucket->portset);
if (err)
- goto lose;
+ goto lose_unlocked;
}
*(void **)result = pi;
@@ -110,6 +110,7 @@ _ports_create_port_internal (struct port_class *class,
err = EINTR;
lose:
mutex_unlock (&_ports_lock);
+ lose_unlocked:
err = mach_port_mod_refs (mach_task_self (), port,
MACH_PORT_RIGHT_RECEIVE, -1);
assert_perror (err);