aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>1999-08-04 18:53:50 +0000
committerBrian Feldman <green@FreeBSD.org>1999-08-04 18:53:50 +0000
commite32c66c53972fb584fdbe1dee5af4682f4844de1 (patch)
treed6e2c042eb44488d55222c34691929682097b9f0 /sys/kern/vfs_syscalls.c
parent42fd81e3c924794a516ce33d85683f00ebed6909 (diff)
downloadsrc-e32c66c53972fb584fdbe1dee5af4682f4844de1.tar.gz
src-e32c66c53972fb584fdbe1dee5af4682f4844de1.zip
Fix fd race conditions (during shared fd table usage.) Badfileops is
now used in f_ops in place of NULL, and modifications to the files are more carefully ordered. f_ops should also be set to &badfileops upon "close" of a file. This does not fix other problems mentioned in this PR than the first one. PR: 11629 Reviewed by: peter
Notes
Notes: svn path=/head/; revision=49413
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 3617bfd14e56..bedf79fa2965 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.127 1999/08/03 17:07:04 imp Exp $
+ * $Id: vfs_syscalls.c,v 1.128 1999/08/04 04:52:18 imp Exp $
*/
/* For 4.3 integer FS ID compatibility */
@@ -995,10 +995,10 @@ open(p, uap)
p->p_dupfd = 0;
vp = nd.ni_vp;
+ fp->f_data = (caddr_t)vp;
fp->f_flag = flags & FMASK;
- fp->f_type = (vp->v_type == VFIFO ? DTYPE_FIFO : DTYPE_VNODE);
fp->f_ops = &vnops;
- fp->f_data = (caddr_t)vp;
+ fp->f_type = (vp->v_type == VFIFO ? DTYPE_FIFO : DTYPE_VNODE);
if (flags & (O_EXLOCK | O_SHLOCK)) {
lf.l_whence = SEEK_SET;
lf.l_start = 0;