Explicitly initialize f_data and f_vnode to NULL.

Report f_vnode to userland in struct xfile.
This commit is contained in:
phk 2004-06-19 11:40:08 +00:00
parent 9695efd3c3
commit 1ce305fbfd

View File

@ -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;