diff --git a/fs/proc/os_adapt/proc_vfs.c b/fs/proc/os_adapt/proc_vfs.c index 2d06f4783e87e97ba3b86eae63e79b3deb432f2a..6dec64523b925818c7a738ca86ef07273e77d30e 100755 --- a/fs/proc/os_adapt/proc_vfs.c +++ b/fs/proc/os_adapt/proc_vfs.c @@ -235,6 +235,13 @@ int VfsProcfsOpen(struct file *filep) if (ProcOpen(pde->pf) != OK) { return -ENOMEM; } + if (S_ISREG(pde->mode) && (pde->procFileOps != NULL) && (pde->procFileOps->open != NULL)) { + (void)pde->procFileOps->open((struct Vnode *)pde, pde->pf); + } + if (S_ISDIR(pde->mode)) { + pde->pdirCurrent = pde->subdir; + pde->pf->fPos = 0; + } filep->f_priv = (void *)pde; return LOS_OK; }