From 78e1fdb971f09c79828f123ebcf03c233534402a Mon Sep 17 00:00:00 2001 From: zhangfanfan2 Date: Fri, 16 Apr 2021 18:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3issueI3J6PP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fs/proc/os_adapt/proc_vfs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/proc/os_adapt/proc_vfs.c b/fs/proc/os_adapt/proc_vfs.c index 2d06f478..6dec6452 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; }