td_dupfd just needs to be less than 0, it does not have to hold the

negative value of the index of the new file, so just use -1.
This commit is contained in:
John Baldwin 2003-08-07 17:08:26 +00:00
parent 65782e561a
commit b2db7dc658
2 changed files with 2 additions and 2 deletions

View File

@ -679,7 +679,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
fp = nfp;
cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT;
NDINIT(&nd, LOOKUP, FOLLOW, pathseg, path, td);
td->td_dupfd = -indx - 1; /* XXX check for fdopen */
td->td_dupfd = -1; /* XXX check for fdopen */
/*
* Bump the ref count to prevent another process from closing
* the descriptor while we are blocked in vn_open()

View File

@ -679,7 +679,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
fp = nfp;
cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT;
NDINIT(&nd, LOOKUP, FOLLOW, pathseg, path, td);
td->td_dupfd = -indx - 1; /* XXX check for fdopen */
td->td_dupfd = -1; /* XXX check for fdopen */
/*
* Bump the ref count to prevent another process from closing
* the descriptor while we are blocked in vn_open()