diff options
| author | Jeffrey Hsu <hsu@FreeBSD.org> | 2003-01-21 20:20:48 +0000 |
|---|---|---|
| committer | Jeffrey Hsu <hsu@FreeBSD.org> | 2003-01-21 20:20:48 +0000 |
| commit | a448a15bc19d31caa3ef3ce12893689735126acd (patch) | |
| tree | 80124e4d20a5843cd261d12fb5d3c05009c25663 | |
| parent | 302b6cd1fe75926ca2e433c05ecfb531527c8e35 (diff) | |
Notes
| -rw-r--r-- | sys/kern/kern_descrip.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index a05eb2529f24..0c392995bfd2 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -288,10 +288,12 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) break; case F_SETFL: - fhold(fp); + FILE_LOCK(fp); FILEDESC_UNLOCK(fdp); + fhold_locked(fp); fp->f_flag &= ~FCNTLFLAGS; fp->f_flag |= FFLAGS(arg & ~O_ACCMODE) & FCNTLFLAGS; + FILE_UNLOCK(fp); tmp = fp->f_flag & FNONBLOCK; error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); if (error) { @@ -304,7 +306,9 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) fdrop(fp, td); break; } + FILE_LOCK(fp); fp->f_flag &= ~FNONBLOCK; + FILE_UNLOCK(fp); tmp = 0; (void)fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); fdrop(fp, td); |
