diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-03-30 17:33:58 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-03-30 17:33:58 +0000 |
commit | 1461be73d18e1e91fee089605841eef06a5594d2 (patch) | |
tree | 3ee58e3a77d2f17365d97f7228fc751b719d2664 | |
parent | 6e5679fe599c53bf6a33e98d3c69b9012d0769cd (diff) |
(trivfs_S_io_duplicate): Slight fix.
-rw-r--r-- | libtrivfs/io-duplicate.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libtrivfs/io-duplicate.c b/libtrivfs/io-duplicate.c index deb32378..26fb0673 100644 --- a/libtrivfs/io-duplicate.c +++ b/libtrivfs/io-duplicate.c @@ -35,13 +35,13 @@ 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; + mutex_lock (&cred->po->cntl->lock); newcred->po = cred->po; newcred->po->refcnt++; + mutex_unlock (&cred->po->cntl->lock); newcred->uids = malloc (cred->nuids * sizeof (uid_t)); newcred->gids = malloc (cred->ngids * sizeof (gid_t)); bcopy (cred->uids, newcred->uids, cred->nuids * sizeof (uid_t)); @@ -53,8 +53,6 @@ trivfs_S_io_duplicate (struct trivfs_protid *cred, newcred->hook = cred->hook; - mutex_unlock (&cred->po->cntl->lock); - if (trivfs_protid_create_hook) (*trivfs_protid_create_hook) (newcred); |