diff options
author | phk <phk@FreeBSD.org> | 2004-06-19 11:40:08 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-06-19 11:40:08 +0000 |
commit | 1ce305fbfd151957d1877c533da0a0578ab04938 (patch) | |
tree | d00e8c4335fcd1560a523b5f7c582f369e774a04 | |
parent | 9695efd3c3122859d53062407f5db55fd4d762d8 (diff) | |
download | FreeBSD-src-1ce305fbfd151957d1877c533da0a0578ab04938.zip FreeBSD-src-1ce305fbfd151957d1877c533da0a0578ab04938.tar.gz |
Explicitly initialize f_data and f_vnode to NULL.
Report f_vnode to userland in struct xfile.
-rw-r--r-- | sys/kern/kern_descrip.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index c61e0ed..7a15e79 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1326,6 +1326,8 @@ falloc(td, resultfp, resultfd) fp->f_count++; fp->f_cred = crhold(td->td_ucred); fp->f_ops = &badfileops; + fp->f_data = NULL; + fp->f_vnode = NULL; FILEDESC_LOCK(p->p_fd); if ((fq = p->p_fd->fd_ofiles[0])) { LIST_INSERT_AFTER(fq, fp, f_list); @@ -2360,6 +2362,7 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) xf.xf_fd = n; xf.xf_file = fp; xf.xf_data = fp->f_data; + xf.xf_vnode = fp->f_vnode; xf.xf_type = fp->f_type; xf.xf_count = fp->f_count; xf.xf_msgcount = fp->f_msgcount; |