From 43d634ce00f39d516f79eea10b1fcd9882cada35 Mon Sep 17 00:00:00 2001 From: chao an Date: Sat, 12 Oct 2024 14:59:29 +0800 Subject: [PATCH] nsh/fsutils: fix build break if CONFIG_NSH_DISABLE_PKILL not disabled arm-none-eabi/bin/ld: apps/libapps.a(nsh_proccmds.c.obj): in function `cmd_pkill': apps/nshlib/nsh_proccmds.c:861:(.text.cmd_pkill+0x38): undefined reference to `nsh_getpid' Signed-off-by: chao an --- nshlib/nsh.h | 2 +- nshlib/nsh_fsutils.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nshlib/nsh.h b/nshlib/nsh.h index f6fb38f9a..35f2d20a3 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -1394,7 +1394,7 @@ int nsh_foreach_direntry(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, * ****************************************************************************/ -#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PIDOF) +#ifdef CONFIG_FS_PROCFS ssize_t nsh_getpid(FAR struct nsh_vtbl_s *vtbl, FAR const char *name, FAR pid_t *pids, size_t count); #endif diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index 309f24dc2..30c2a19e9 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -63,7 +63,7 @@ struct getpid_arg_s * ****************************************************************************/ -#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PIDOF) +#ifdef CONFIG_FS_PROCFS static int getpid_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath, FAR struct dirent *entryp, FAR void *pvarg) @@ -604,7 +604,7 @@ FAR char *nsh_getdirpath(FAR struct nsh_vtbl_s *vtbl, * ****************************************************************************/ -#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PIDOF) +#ifdef CONFIG_FS_PROCFS ssize_t nsh_getpid(FAR struct nsh_vtbl_s *vtbl, FAR const char *name, FAR pid_t *pids, size_t count) {