summaryrefslogtreecommitdiff
path: root/libtrivfs/io-duplicate.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-03-30 17:30:10 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-03-30 17:30:10 +0000
commitf71f6b6bee22cd0a53d3a536ed1409d5910a0af2 (patch)
tree58aeccd7dbf2e2da94573b4a107b8c2192f12e97 /libtrivfs/io-duplicate.c
parent3d9a0853ee57720e8023e9a013b65696e6685506 (diff)
(trivfs_S_io_duplicate): Lock CRED->po->cntl->lock around relevant
code.
Diffstat (limited to 'libtrivfs/io-duplicate.c')
-rw-r--r--libtrivfs/io-duplicate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libtrivfs/io-duplicate.c b/libtrivfs/io-duplicate.c
index faf500c6..deb32378 100644
--- a/libtrivfs/io-duplicate.c
+++ b/libtrivfs/io-duplicate.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1993, 1994 Free Software Foundation
+ Copyright (C) 1993, 1994, 1995 Free Software Foundation
This file is part of the GNU Hurd.
@@ -35,6 +35,8 @@ trivfs_S_io_duplicate (struct trivfs_protid *cred,
if (!cred)
return EOPNOTSUPP;
+ mutex_lock (&cred->po->cntl->lock);
+
newcred = ports_allocate_port (sizeof (struct trivfs_protid), cred->pi.type);
newcred->realnode = cred->realnode;
newcred->isroot = cred->isroot;
@@ -50,6 +52,8 @@ trivfs_S_io_duplicate (struct trivfs_protid *cred,
MACH_PORT_RIGHT_SEND, 1);
newcred->hook = cred->hook;
+
+ mutex_unlock (&cred->po->cntl->lock);
if (trivfs_protid_create_hook)
(*trivfs_protid_create_hook) (newcred);