From: sunghan Date: Fri, 31 Mar 2017 07:16:04 +0000 (+0900) Subject: fix build error on procfs X-Git-Tag: 1.1_Public_Release~636^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2bcb98913b3f037ddb6c9c43eff53ca158fa28a;p=rtos%2Ftinyara.git fix build error on procfs Some variables are only used when CONFIG_FS_PROCFS_EXCLUDE_PROCESS is disabled. procfs/fs_procfs.c: In function 'procfs_opendir': procfs/fs_procfs.c:439:13: error: unused variable 'flags' [-Werror=unused-variable] irqstate_t flags; ^ procfs/fs_procfs.c: In function 'procfs_readdir': procfs/fs_procfs.c:590:8: error: unused variable 'pid' [-Werror=unused-variable] pid_t pid; ^ procfs/fs_procfs.c:589:13: error: unused variable 'flags' [-Werror=unused-variable] irqstate_t flags; ^ procfs/fs_procfs.c:586:20: error: unused variable 'tcb' [-Werror=unused-variable] FAR struct tcb_s *tcb; --- diff --git a/os/fs/procfs/fs_procfs.c b/os/fs/procfs/fs_procfs.c index f5bb604..cd09c4e 100644 --- a/os/fs/procfs/fs_procfs.c +++ b/os/fs/procfs/fs_procfs.c @@ -436,7 +436,9 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, FA FAR struct procfs_level0_s *level0; FAR struct procfs_dir_priv_s *dirpriv; FAR void *priv = NULL; +#ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS irqstate_t flags; +#endif fvdbg("relpath: \"%s\"\n", relpath ? relpath : "NULL"); DEBUGASSERT(mountpt && relpath && dir && !dir->u.procfs); @@ -583,11 +585,13 @@ static int procfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) { FAR struct procfs_dir_priv_s *priv; FAR struct procfs_level0_s *level0; - FAR struct tcb_s *tcb; FAR const char *name = NULL; unsigned int index; +#ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS + FAR struct tcb_s *tcb; irqstate_t flags; pid_t pid; +#endif int ret = -ENOENT; DEBUGASSERT(mountpt && dir && dir->u.procfs);