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:
parent
65782e561a
commit
b2db7dc658
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user