summaryrefslogtreecommitdiff
path: root/libmom
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-05-25 21:32:26 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-05-25 21:32:26 +0000
commit0e32f27c58ef8ba3c0c54c48f296c922424df0a4 (patch)
tree15da7d31da012dcf2b06b8cb63b574d62ca5f956 /libmom
parente55dcf16d03bd83a72efa23a1d68d3f3c796e6f0 (diff)
(mom_copy_ref): Omit uses of deleted members of struct mom_port_ref.c
Diffstat (limited to 'libmom')
-rw-r--r--libmom/copy-ref.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libmom/copy-ref.c b/libmom/copy-ref.c
index f0d37954..03d4ab45 100644
--- a/libmom/copy-ref.c
+++ b/libmom/copy-ref.c
@@ -26,18 +26,9 @@ mom_copy_ref (struct mom_port_ref *new,
{
error_t err;
- new->lock = SPIN_LOCK_INITIALIZER;
-
- spin_lock (&obj->lock);
- assert (obj->refcnt);
err = mach_port_mod_refs (mach_task_self (),
obj->port, MACH_PORT_RIGHT_SEND, 1);
- new->port = obj->port;
- spin_unlock (&obj->lock);
-
- if (err)
- return err;
-
- new->refcnt = 1;
- return 0;
+ if (!err)
+ new->port = obj->port;
+ return err;
}