From f71f6b6bee22cd0a53d3a536ed1409d5910a0af2 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 30 Mar 1995 17:30:10 +0000 Subject: (trivfs_S_io_duplicate): Lock CRED->po->cntl->lock around relevant code. --- libtrivfs/io-duplicate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3