From 7d517413cbe2ff0af2024443cf0d649ce4d564cc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 20 Jul 2016 10:46:05 -0600 Subject: [PATCH] Things that use mkfifo() and pipe() depend on CONFIG_PIPES --- examples/README.txt | 2 +- examples/cpuhog/Kconfig | 9 +++++---- examples/pipe/Kconfig | 1 + examples/poll/Kconfig | 2 +- nshlib/Kconfig | 1 + nshlib/README.txt | 2 +- nshlib/nsh.h | 2 +- nshlib/nsh_command.c | 2 +- nshlib/nsh_fscmds.c | 2 +- 9 files changed, 13 insertions(+), 10 deletions(-) diff --git a/examples/README.txt b/examples/README.txt index c79fb01d2..3331fe2e9 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -1489,7 +1489,7 @@ examples/pca9635 examples/pipe ^^^^^^^^^^^^^ - A test of the mkfifo() and pipe() APIs. + A test of the mkfifo() and pipe() APIs. Requires CONFIG_PIPES * CONFIG_EXAMPLES_PIPE_STACKSIZE Sets the size of the stack to use when creating the child tasks. diff --git a/examples/cpuhog/Kconfig b/examples/cpuhog/Kconfig index f68d4b37b..47a5b3702 100644 --- a/examples/cpuhog/Kconfig +++ b/examples/cpuhog/Kconfig @@ -4,10 +4,11 @@ # config EXAMPLES_CPUHOG - bool "CPU hog" - default n - ---help--- - Enable the cpuhog example + bool "CPU hog" + default n + depends on PIPES + ---help--- + Enable the cpuhog example if EXAMPLES_CPUHOG diff --git a/examples/pipe/Kconfig b/examples/pipe/Kconfig index 48142315d..d6ca33bc8 100644 --- a/examples/pipe/Kconfig +++ b/examples/pipe/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_PIPE bool "Pipe example" default n + depends on PIPES ---help--- Enable the pipe example diff --git a/examples/poll/Kconfig b/examples/poll/Kconfig index 5d26f9bb6..f07412fa3 100644 --- a/examples/poll/Kconfig +++ b/examples/poll/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_POLL bool "Poll example" default n - depends on !NSH_BUILTIN_APPS + depends on !NSH_BUILTIN_APPS && PIPES ---help--- Enable the poll example diff --git a/nshlib/Kconfig b/nshlib/Kconfig index adce702a2..60e6d4e25 100644 --- a/nshlib/Kconfig +++ b/nshlib/Kconfig @@ -344,6 +344,7 @@ config NSH_DISABLE_MKFIFO bool "Disable mkfifo" default y if DEFAULT_SMALL default n if !DEFAULT_SMALL + depends on PIPES config NSH_DISABLE_MKRD bool "Disable mkrd" diff --git a/nshlib/README.txt b/nshlib/README.txt index c315ecfc5..a5e3c3003 100644 --- a/nshlib/README.txt +++ b/nshlib/README.txt @@ -1201,7 +1201,7 @@ Command Dependencies on Configuration Settings mb,mh,mw --- mkdir (((!CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE) || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && CONFIG_NFILE_DESCRIPTORS > 0) mkfatfs !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_FAT - mkfifo CONFIG_NFILE_DESCRIPTORS > 0 + mkfifo CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_PIPES mkrd !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_WRITABLE (see note 4) mount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_READABLE (see note 3) mv (((!CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE) || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && CONFIG_NFILE_DESCRIPTORS > 0) (see note 4) diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 9883c6ce4..3f6f57414 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -1039,7 +1039,7 @@ int cmd_lsmod(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # if defined(CONFIG_SMART_DEV_LOOP) && !defined(CONFIG_NSH_DISABLE_LOSMART) int cmd_losmart(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif -# ifndef CONFIG_NSH_DISABLE_MKFIFO +# if defined(CONFIG_PIPES) && !defined(CONFIG_NSH_DISABLE_MKFIFO) int cmd_mkfifo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif # ifdef CONFIG_FS_READABLE diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index ee820bb93..7aa6b1ad3 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -297,7 +297,7 @@ static const struct cmdmap_s g_cmdmap[] = #endif #if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 -# ifndef CONFIG_NSH_DISABLE_MKFIFO +# if defined(CONFIG_PIPES) && !defined(CONFIG_NSH_DISABLE_MKFIFO) { "mkfifo", cmd_mkfifo, 2, 2, "" }, # endif #endif diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c index 00fd8431b..7dccf1e76 100644 --- a/nshlib/nsh_fscmds.c +++ b/nshlib/nsh_fscmds.c @@ -1181,7 +1181,7 @@ int cmd_mkfatfs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) ****************************************************************************/ #if CONFIG_NFILE_DESCRIPTORS > 0 -#ifndef CONFIG_NSH_DISABLE_MKFIFO +#if defined(CONFIG_PIPES) && !defined(CONFIG_NSH_DISABLE_MKFIFO) int cmd_mkfifo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { char *fullpath = nsh_getfullpath(vtbl, argv[1]);