Set the umask in a new file descriptor table earlier in fdcopy() to remove
two lock operations.
This commit is contained in:
parent
498a9afee2
commit
6ca33ea345
@ -1626,17 +1626,15 @@ fdcopy(struct filedesc *fdp)
|
||||
newfdp->fd_freefile = i;
|
||||
}
|
||||
}
|
||||
newfdp->fd_cmask = fdp->fd_cmask;
|
||||
FILEDESC_SUNLOCK(fdp);
|
||||
FILEDESC_XLOCK(newfdp);
|
||||
for (i = 0; i <= newfdp->fd_lastfile; ++i)
|
||||
if (newfdp->fd_ofiles[i] != NULL)
|
||||
fdused(newfdp, i);
|
||||
FILEDESC_XUNLOCK(newfdp);
|
||||
FILEDESC_SLOCK(fdp);
|
||||
if (newfdp->fd_freefile == -1)
|
||||
newfdp->fd_freefile = i;
|
||||
newfdp->fd_cmask = fdp->fd_cmask;
|
||||
FILEDESC_SUNLOCK(fdp);
|
||||
FILEDESC_XUNLOCK(newfdp);
|
||||
return (newfdp);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user