From 8f5944c4a89a6cfed942c1807825e5c01cb6696a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 29 Apr 2019 14:53:38 -0600 Subject: [PATCH] Squashed commit of the following: include/ and netutils/: Remove references to CONFIG_DISABLE_SIGNALS. Signals can no longer be disabled. nshlib/: Remove references to CONFIG_DISABLE_SIGNALS. Signals can no longer be disabled. system/: Remove references to CONFIG_DISABLE_SIGNALS. Signals can no longer be disabled. testing/: Remove references to CONFIG_DISABLE_SIGNALS. Signals can no longer be disabled. examples/: Remove references to CONFIG_DISABLE_SIGNALS. Signals can no longer be disabled. --- examples/README.txt | 5 ----- examples/ajoystick/Kconfig | 2 +- examples/buttons/Kconfig | 13 +++++++++++++ examples/buttons/buttons_main.c | 24 +++++++----------------- examples/djoystick/Kconfig | 2 +- examples/elf/tests/Makefile | 6 +----- examples/nx/nx_internal.h | 3 --- examples/nxdemo/nxdemo.h | 3 --- examples/nxhello/nxhello.h | 3 --- examples/nximage/nximage.h | 3 --- examples/nxlines/nxlines.h | 3 --- examples/nxterm/nxterm_internal.h | 3 --- examples/nxtext/nxtext_internal.h | 3 --- examples/zerocross/Kconfig | 2 +- include/netutils/netinit.h | 3 +-- include/netutils/ntpclient.h | 2 -- netutils/netinit/Kconfig | 2 +- netutils/ntpclient/Kconfig | 1 - netutils/ntpclient/ntpclient.c | 2 -- nshlib/README.txt | 10 +++++----- nshlib/nsh.h | 16 ++++++---------- nshlib/nsh_command.c | 12 +++--------- nshlib/nsh_fscmds.c | 6 ++---- nshlib/nsh_fsutils.c | 4 ---- nshlib/nsh_parse.c | 4 ---- nshlib/nsh_proccmds.c | 22 ---------------------- system/composite/composite.h | 4 ++-- system/composite/composite_main.c | 18 ++++++------------ system/sched_note/note_main.c | 2 -- system/usbmsc/usbmsc_main.c | 22 ++++------------------ testing/ostest/Kconfig | 3 +-- testing/ostest/Makefile | 7 ++----- testing/ostest/cancel.c | 4 ++-- testing/ostest/ostest.h | 8 -------- testing/ostest/ostest_main.c | 2 -- 35 files changed, 59 insertions(+), 170 deletions(-) diff --git a/examples/README.txt b/examples/README.txt index 9f52c12d9..035594c92 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -56,7 +56,6 @@ examples/ajoystick Configuration Pre-requisites: - CONFIG_DISABLE_SIGNALS - Must *NOT* be selected CONFIG_AJOYSTICK - The analog joystick driver Example Configuration: @@ -292,7 +291,6 @@ examples/djoystick Configuration Pre-requisites: - CONFIG_DISABLE_SIGNALS - Must *NOT* be selected CONFIG_DJOYSTICK - The discrete joystick driver Example Configuration: @@ -979,7 +977,6 @@ examples/nx if they are not as expected: CONFIG_DISABLE_MQUEUE=n - CONFIG_DISABLE_SIGNALS=n CONFIG_DISABLE_PTHREAD=n CONFIG_NX_BLOCKING=y CONFIG_LIB_BOARDCTL=y @@ -996,7 +993,6 @@ examples/nxterm CONFIG_NX=y -- NX graphics must be enabled CONFIG_NXTERM=y -- The NX console driver must be built CONFIG_DISABLE_MQUEUE=n -- Message queue support must be available. - CONFIG_DISABLE_SIGNALS=n -- Signals are needed CONFIG_DISABLE_PTHREAD=n -- pthreads are needed CONFIG_NX_BLOCKING=y -- pthread APIs must be blocking CONFIG_NSH_CONSOLE=y -- NSH must be configured to use a console. @@ -1194,7 +1190,6 @@ examples/nxtext error if they are not as expected: CONFIG_DISABLE_MQUEUE=n - CONFIG_DISABLE_SIGNALS=n CONFIG_DISABLE_PTHREAD=n CONFIG_NX_BLOCKING=y diff --git a/examples/ajoystick/Kconfig b/examples/ajoystick/Kconfig index ae4bb1aea..3e7902c6c 100644 --- a/examples/ajoystick/Kconfig +++ b/examples/ajoystick/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_AJOYSTICK tristate "Analog joystick example" default n - depends on AJOYSTICK && !DISABLE_SIGNALS + depends on AJOYSTICK ---help--- Enable the analog joystick example diff --git a/examples/buttons/Kconfig b/examples/buttons/Kconfig index ef4bda57e..cab8d3559 100644 --- a/examples/buttons/Kconfig +++ b/examples/buttons/Kconfig @@ -38,6 +38,19 @@ config EXAMPLES_BUTTONS_NAMES ---help--- Enable to show the button's name in the application. +choice + prompt "Notification mechanism" + default EXAMPLES_BUTTONS_SIGNAL + +config EXAMPLES_BUTTONS_SIGNAL + bool "Notify using signals" + +config EXAMPLES_BUTTONS_POLL + bool "Notify using poll()" + depends on !DISABLE_POLL + +endchoice + if EXAMPLES_BUTTONS_NAMES config EXAMPLES_BUTTONS_QTD diff --git a/examples/buttons/buttons_main.c b/examples/buttons/buttons_main.c index cb577a0d5..2fb9ca175 100644 --- a/examples/buttons/buttons_main.c +++ b/examples/buttons/buttons_main.c @@ -59,16 +59,6 @@ # error "CONFIG_BUTTONS is not defined in the configuration" #endif -#if defined(CONFIG_DISABLE_SIGNALS) && defined(CONFIG_DISABLE_POLL) -# error "You need at least SIGNALS or POLL support to read buttons" -#endif - -#if !defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_POLL) -# define USE_NOTIFY_SIGNAL 1 -#else -# define USE_NOTIFY_POLL 1 -#endif - #ifndef CONFIG_BUTTONS_NPOLLWAITERS # define CONFIG_BUTTONS_NPOLLWAITERS 2 #endif @@ -167,11 +157,11 @@ static bool g_button_daemon_started; static int button_daemon(int argc, char *argv[]) { -#ifdef USE_NOTIFY_POLL +#ifdef CONFIG_EXAMPLES_BUTTONS_POLL struct pollfd fds[CONFIG_BUTTONS_NPOLLWAITERS]; #endif -#ifdef USE_NOTIFY_SIGNAL +#ifdef CONFIG_EXAMPLES_BUTTONS_SIGNAL struct btn_notify_s btnevents; #endif @@ -219,7 +209,7 @@ static int button_daemon(int argc, char *argv[]) printf("button_daemon: Supported BUTTONs 0x%02x\n", (unsigned int)supported); -#ifdef USE_NOTIFY_SIGNAL +#ifdef CONFIG_EXAMPLES_BUTTONS_SIGNAL /* Define the notifications events */ btnevents.bn_press = supported; @@ -245,18 +235,18 @@ static int button_daemon(int argc, char *argv[]) for (; ; ) { -#ifdef USE_NOTIFY_SIGNAL +#ifdef CONFIG_EXAMPLES_BUTTONS_SIGNAL struct siginfo value; sigset_t set; #endif -#ifdef USE_NOTIFY_POLL +#ifdef CONFIG_EXAMPLES_BUTTONS_POLL bool timeout; bool pollin; int nbytes; #endif -#ifdef USE_NOTIFY_SIGNAL +#ifdef CONFIG_EXAMPLES_BUTTONS_SIGNAL /* Wait for a signal */ (void)sigemptyset(&set); @@ -272,7 +262,7 @@ static int button_daemon(int argc, char *argv[]) sample = (btn_buttonset_t)value.si_value.sival_int; #endif -#ifdef USE_NOTIFY_POLL +#ifdef CONFIG_EXAMPLES_BUTTONS_POLL /* Prepare the File Descriptor for poll */ memset(fds, 0, sizeof(struct pollfd)*CONFIG_BUTTONS_NPOLLWAITERS); diff --git a/examples/djoystick/Kconfig b/examples/djoystick/Kconfig index 86581a864..9226299b6 100644 --- a/examples/djoystick/Kconfig +++ b/examples/djoystick/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_DJOYSTICK tristate "Discrete joystick example" default n - depends on DJOYSTICK && !DISABLE_SIGNALS + depends on DJOYSTICK ---help--- Enable the discrete joystick example diff --git a/examples/elf/tests/Makefile b/examples/elf/tests/Makefile index a062ab187..57e13a95b 100644 --- a/examples/elf/tests/Makefile +++ b/examples/elf/tests/Makefile @@ -38,7 +38,7 @@ include $(APPDIR)/Make.defs ALL_SUBDIRS = errno hello helloxx longjmp mutex pthread signal task struct -BUILD_SUBDIRS = errno hello struct +BUILD_SUBDIRS = errno hello struct signal ifeq ($(CONFIG_HAVE_CXX),y) BUILD_SUBDIRS += helloxx @@ -52,10 +52,6 @@ ifneq ($(CONFIG_DISABLE_PTHREAD),y) BUILD_SUBDIRS += mutex pthread endif -ifneq ($(CONFIG_DISABLE_SIGNALS),y) -BUILD_SUBDIRS += signal -endif - ifneq ($(CONFIG_ARCH_ADDRENV),y) BUILD_SUBDIRS += task endif diff --git a/examples/nx/nx_internal.h b/examples/nx/nx_internal.h index f20d69f71..f089871b4 100644 --- a/examples/nx/nx_internal.h +++ b/examples/nx/nx_internal.h @@ -131,9 +131,6 @@ #ifdef CONFIG_DISABLE_MQUEUE # error "The multi-threaded example requires MQ support (CONFIG_DISABLE_MQUEUE=n)" #endif -#ifdef CONFIG_DISABLE_SIGNALS -# error "This example requires signal support (CONFIG_DISABLE_SIGNALS=n)" -#endif #ifdef CONFIG_DISABLE_PTHREAD # error "This example requires pthread support (CONFIG_DISABLE_PTHREAD=n)" #endif diff --git a/examples/nxdemo/nxdemo.h b/examples/nxdemo/nxdemo.h index a3ef83d05..6e2ba9b71 100644 --- a/examples/nxdemo/nxdemo.h +++ b/examples/nxdemo/nxdemo.h @@ -96,9 +96,6 @@ #ifdef CONFIG_DISABLE_MQUEUE # error "The multi-threaded example requires MQ support (CONFIG_DISABLE_MQUEUE=n)" #endif -#ifdef CONFIG_DISABLE_SIGNALS -# error "This example requires signal support (CONFIG_DISABLE_SIGNALS=n)" -#endif #ifdef CONFIG_DISABLE_PTHREAD # error "This example requires pthread support (CONFIG_DISABLE_PTHREAD=n)" #endif diff --git a/examples/nxhello/nxhello.h b/examples/nxhello/nxhello.h index c41fa400a..2c01b8fbd 100644 --- a/examples/nxhello/nxhello.h +++ b/examples/nxhello/nxhello.h @@ -99,9 +99,6 @@ #ifdef CONFIG_DISABLE_MQUEUE # error "The multi-threaded example requires MQ support (CONFIG_DISABLE_MQUEUE=n)" #endif -#ifdef CONFIG_DISABLE_SIGNALS -# error "This example requires signal support (CONFIG_DISABLE_SIGNALS=n)" -#endif #ifdef CONFIG_DISABLE_PTHREAD # error "This example requires pthread support (CONFIG_DISABLE_PTHREAD=n)" #endif diff --git a/examples/nximage/nximage.h b/examples/nximage/nximage.h index 9752daf99..b8bcfd532 100644 --- a/examples/nximage/nximage.h +++ b/examples/nximage/nximage.h @@ -108,9 +108,6 @@ #ifdef CONFIG_DISABLE_MQUEUE # error "The multi-threaded example requires MQ support (CONFIG_DISABLE_MQUEUE=n)" #endif -#ifdef CONFIG_DISABLE_SIGNALS -# error "This example requires signal support (CONFIG_DISABLE_SIGNALS=n)" -#endif #ifdef CONFIG_DISABLE_PTHREAD # error "This example requires pthread support (CONFIG_DISABLE_PTHREAD=n)" #endif diff --git a/examples/nxlines/nxlines.h b/examples/nxlines/nxlines.h index 24e066fe8..03191a7ab 100644 --- a/examples/nxlines/nxlines.h +++ b/examples/nxlines/nxlines.h @@ -117,9 +117,6 @@ #ifdef CONFIG_DISABLE_MQUEUE # error "The multi-threaded example requires MQ support (CONFIG_DISABLE_MQUEUE=n)" #endif -#ifdef CONFIG_DISABLE_SIGNALS -# error "This example requires signal support (CONFIG_DISABLE_SIGNALS=n)" -#endif #ifdef CONFIG_DISABLE_PTHREAD # error "This example requires pthread support (CONFIG_DISABLE_PTHREAD=n)" #endif diff --git a/examples/nxterm/nxterm_internal.h b/examples/nxterm/nxterm_internal.h index 2da2d3d81..24e5614c0 100644 --- a/examples/nxterm/nxterm_internal.h +++ b/examples/nxterm/nxterm_internal.h @@ -179,9 +179,6 @@ #ifdef CONFIG_DISABLE_MQUEUE # error "The multi-threaded example requires MQ support (CONFIG_DISABLE_MQUEUE=n)" #endif -#ifdef CONFIG_DISABLE_SIGNALS -# error "This example requires signal support (CONFIG_DISABLE_SIGNALS=n)" -#endif #ifdef CONFIG_DISABLE_PTHREAD # error "This example requires pthread support (CONFIG_DISABLE_PTHREAD=n)" #endif diff --git a/examples/nxtext/nxtext_internal.h b/examples/nxtext/nxtext_internal.h index 9921ad1f2..8118b331d 100644 --- a/examples/nxtext/nxtext_internal.h +++ b/examples/nxtext/nxtext_internal.h @@ -170,9 +170,6 @@ #ifdef CONFIG_DISABLE_MQUEUE # error "The multi-threaded example requires MQ support (CONFIG_DISABLE_MQUEUE=n)" #endif -#ifdef CONFIG_DISABLE_SIGNALS -# error "This example requires signal support (CONFIG_DISABLE_SIGNALS=n)" -#endif #ifdef CONFIG_DISABLE_PTHREAD # error "This example requires pthread support (CONFIG_DISABLE_PTHREAD=n)" #endif diff --git a/examples/zerocross/Kconfig b/examples/zerocross/Kconfig index 69bd20da1..d5c1245b2 100644 --- a/examples/zerocross/Kconfig +++ b/examples/zerocross/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_ZEROCROSS tristate "Zero Cross Detection example" default n - depends on SENSORS_ZEROCROSS && !DISABLE_SIGNALS + depends on SENSORS_ZEROCROSS ---help--- Enable the zero cross detection example diff --git a/include/netutils/netinit.h b/include/netutils/netinit.h index cb9a4ce79..f0286f5e9 100644 --- a/include/netutils/netinit.h +++ b/include/netutils/netinit.h @@ -75,8 +75,7 @@ #endif #if !defined(CONFIG_NETINIT_THREAD) || !defined(CONFIG_ARCH_PHY_INTERRUPT) || \ - !defined(CONFIG_NETDEV_PHY_IOCTL) || !defined(CONFIG_NET_UDP) || \ - defined(CONFIG_DISABLE_SIGNALS) + !defined(CONFIG_NETDEV_PHY_IOCTL) || !defined(CONFIG_NET_UDP) # undef CONFIG_NETINIT_MONITOR #endif diff --git a/include/netutils/ntpclient.h b/include/netutils/ntpclient.h index 9d3f4ad21..84239c427 100644 --- a/include/netutils/ntpclient.h +++ b/include/netutils/ntpclient.h @@ -116,9 +116,7 @@ int ntpc_start(void); * ****************************************************************************/ -#ifndef CONFIG_DISABLE_SIGNALS int ntpc_stop(void); -#endif #undef EXTERN #ifdef __cplusplus diff --git a/netutils/netinit/Kconfig b/netutils/netinit/Kconfig index 42318cf5b..64c1ac6eb 100644 --- a/netutils/netinit/Kconfig +++ b/netutils/netinit/Kconfig @@ -73,7 +73,7 @@ if NETINIT_THREAD config NETINIT_MONITOR bool "Monitor link state" default n - depends on ARCH_PHY_INTERRUPT && NETDEV_PHY_IOCTL && NET_UDP && !DISABLE_SIGNALS + depends on ARCH_PHY_INTERRUPT && NETDEV_PHY_IOCTL && NET_UDP ---help--- By default the net initialization thread will bring-up the network then exit, freeing all of the resources that it required. This is a diff --git a/netutils/ntpclient/Kconfig b/netutils/ntpclient/Kconfig index 21974e37f..2bfe948bf 100755 --- a/netutils/ntpclient/Kconfig +++ b/netutils/ntpclient/Kconfig @@ -41,6 +41,5 @@ config NETUTILS_NTPCLIENT_POLLDELAYSEC config NETUTILS_NTPCLIENT_SIGWAKEUP int "NTP client wakeup signal number" default 18 - depends on !DISABLE_SIGNALS endif # NETUTILS_NTPCLIENT diff --git a/netutils/ntpclient/ntpclient.c b/netutils/ntpclient/ntpclient.c index 162163895..046e73aa8 100644 --- a/netutils/ntpclient/ntpclient.c +++ b/netutils/ntpclient/ntpclient.c @@ -587,7 +587,6 @@ int ntpc_start(void) * ****************************************************************************/ -#ifndef CONFIG_DISABLE_SIGNALS int ntpc_stop(void) { int ret; @@ -628,4 +627,3 @@ int ntpc_stop(void) sched_unlock(); return OK; } -#endif diff --git a/nshlib/README.txt b/nshlib/README.txt index 9716ea8c4..df5bd37e7 100644 --- a/nshlib/README.txt +++ b/nshlib/README.txt @@ -1441,7 +1441,7 @@ Command Dependencies on Configuration Settings ifup CONFIG_NET && CONFIG_FS_PROCFS && !CONFIG_FS_PROCFS_EXCLUDE_NET insmod CONFIG_MODULE irqinfo CONFIG_FS_PROCFS && CONFIG_SCHED_IRQMONITOR - kill !CONFIG_DISABLE_SIGNALS + kill -- losetup !CONFIG_DISABLE_MOUNTPOINT && CONFIG_DEV_LOOP ln CONFIG_PSEUDOFS_SOFTLINK ls -- @@ -1472,7 +1472,7 @@ Command Dependencies on Configuration Settings set CONFIG_NSH_VARS || !CONFIG_DISABLE_ENVIRON sh CONFIG_NFILE_STREAMS > 0 && !CONFIG_NSH_DISABLESCRIPT shutdown CONFIG_BOARDCTL_POWEROFF || CONFIG_BOARDCTL_RESET - sleep !CONFIG_DISABLE_SIGNALS + sleep -- test !CONFIG_NSH_DISABLESCRIPT telnetd CONFIG_NSH_TELNET && !CONFIG_NSH_DISABLE_TELNETD time --- @@ -1484,7 +1484,7 @@ Command Dependencies on Configuration Settings urlencode CONFIG_NETUTILS_CODECS && CONFIG_CODECS_URLCODE useradd !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE && CONFIG_NSH_LOGIN_PASSWD userdel !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE && CONFIG_NSH_LOGIN_PASSWD - usleep !CONFIG_DISABLE_SIGNALS + usleep -- get CONFIG_NET && CONFIG_NET_TCP xd --- @@ -1536,9 +1536,9 @@ All built-in applications require that support for NSH built-in applications has Application Depends on Configuration ----------- -------------------------- ping CONFIG_NET && CONFIG_NET_ICMP && CONFIG_NET_ICMP_SOCKET && - CONFIG_SYSTEM_PING && !CONFIG_DISABLE_POLL && !CONFIG_DISABLE_SIGNALS + CONFIG_SYSTEM_PING && !CONFIG_DISABLE_POLL ping6 CONFIG_NET && CONFIG_NET_ICMPv6 && CONFIG_NET_ICMPv6_SOCKET && - CONFIG_SYSTEM_PING6 && !CONFIG_DISABLE_POLL && !CONFIG_DISABLE_SIGNALS + CONFIG_SYSTEM_PING6 && !CONFIG_DISABLE_POLL NSH-Specific Configuration Settings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 57b8fe441..440735bcc 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -851,9 +851,7 @@ extern const char g_fmtcontext[]; extern const char g_fmtcmdfailed[]; extern const char g_fmtcmdoutofmemory[]; extern const char g_fmtinternalerror[]; -#ifndef CONFIG_DISABLE_SIGNALS extern const char g_fmtsignalrecvd[]; -#endif /**************************************************************************** * Public Function Prototypes @@ -1208,17 +1206,15 @@ int cmd_irqinfo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); int cmd_unset(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); #endif -#ifndef CONFIG_DISABLE_SIGNALS -# ifndef CONFIG_NSH_DISABLE_KILL +#ifndef CONFIG_NSH_DISABLE_KILL int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); -# endif -# ifndef CONFIG_NSH_DISABLE_SLEEP +#endif +#ifndef CONFIG_NSH_DISABLE_SLEEP int cmd_sleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); -# endif -# ifndef CONFIG_NSH_DISABLE_USLEEP +#endif +#ifndef CONFIG_NSH_DISABLE_USLEEP int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); -# endif -#endif /* CONFIG_DISABLE_SIGNALS */ +#endif #if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_BASE64) # ifndef CONFIG_NSH_DISABLE_BASE64DEC diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index 6cd602f18..cb9061ff4 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -254,10 +254,8 @@ static const struct cmdmap_s g_cmdmap[] = { "irqinfo", cmd_irqinfo, 1, 1, NULL }, #endif -#ifndef CONFIG_DISABLE_SIGNALS -# ifndef CONFIG_NSH_DISABLE_KILL +#ifndef CONFIG_NSH_DISABLE_KILL { "kill", cmd_kill, 3, 3, "- " }, -# endif #endif #ifndef CONFIG_DISABLE_MOUNTPOINT @@ -474,10 +472,8 @@ static const struct cmdmap_s g_cmdmap[] = #endif #endif -#ifndef CONFIG_DISABLE_SIGNALS -# ifndef CONFIG_NSH_DISABLE_SLEEP +#ifndef CONFIG_NSH_DISABLE_SLEEP { "sleep", cmd_sleep, 2, 2, "" }, -# endif #endif #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_TEST) @@ -544,10 +540,8 @@ static const struct cmdmap_s g_cmdmap[] = # endif #endif -#ifndef CONFIG_DISABLE_SIGNALS -# ifndef CONFIG_NSH_DISABLE_USLEEP +#ifndef CONFIG_NSH_DISABLE_USLEEP { "usleep", cmd_usleep, 2, 2, "" }, -# endif #endif #ifdef CONFIG_NET_TCP diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c index 728a8fee8..8473dca6d 100644 --- a/nshlib/nsh_fscmds.c +++ b/nshlib/nsh_fscmds.c @@ -609,18 +609,17 @@ int cmd_cp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { /* EINTR is not an error (but will still stop the copy) */ -#ifndef CONFIG_DISABLE_SIGNALS if (errno == EINTR) { nsh_error(vtbl, g_fmtsignalrecvd, argv[0]); } else -#endif { /* Read error */ nsh_error(vtbl, g_fmtcmdfailed, argv[0], "read", NSH_ERRNO); } + goto errout_with_wrfd; } } @@ -637,18 +636,17 @@ int cmd_cp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { /* EINTR is not an error (but will still stop the copy) */ -#ifndef CONFIG_DISABLE_SIGNALS if (errno == EINTR) { nsh_error(vtbl, g_fmtsignalrecvd, argv[0]); } else -#endif { /* Read error */ nsh_error(vtbl, g_fmtcmdfailed, argv[0], "write", NSH_ERRNO); } + goto errout_with_wrfd; } } diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index 0dfe5c1dd..ddce5de2d 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -111,13 +111,11 @@ int nsh_catfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, /* EINTR is not an error (but will stop stop the cat) */ -#ifndef CONFIG_DISABLE_SIGNALS if (errval == EINTR) { nsh_error(vtbl, g_fmtsignalrecvd, cmd); } else -#endif { nsh_error(vtbl, g_fmtcmdfailed, cmd, "read", NSH_ERRNO_OF(errval)); } @@ -142,13 +140,11 @@ int nsh_catfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, /* EINTR is not an error (but will stop stop the cat) */ -#ifndef CONFIG_DISABLE_SIGNALS if (errcode == EINTR) { nsh_error(vtbl, g_fmtsignalrecvd, cmd); } else -#endif { nsh_error(vtbl, g_fmtcmdfailed, cmd, "write", NSH_ERRNO_OF(errcode)); diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index ee414603d..8a0edf424 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -280,9 +280,7 @@ const char g_fmtcmdfailed[] = "nsh: %s: %s failed: %d\n"; #endif const char g_fmtcmdoutofmemory[] = "nsh: %s: out of memory\n"; const char g_fmtinternalerror[] = "nsh: %s: Internal error\n"; -#ifndef CONFIG_DISABLE_SIGNALS const char g_fmtsignalrecvd[] = "nsh: %s: Interrupted by signal\n"; -#endif /**************************************************************************** * Private Functions @@ -834,13 +832,11 @@ static FAR char *nsh_filecat(FAR struct nsh_vtbl_s *vtbl, FAR char *s1, { /* EINTR is not an error (but will still stop the copy) */ -#ifndef CONFIG_DISABLE_SIGNALS if (errno == EINTR) { nsh_error(vtbl, g_fmtsignalrecvd, "``"); } else -#endif { /* Read error */ diff --git a/nshlib/nsh_proccmds.c b/nshlib/nsh_proccmds.c index ab8ae3b83..471631431 100644 --- a/nshlib/nsh_proccmds.c +++ b/nshlib/nsh_proccmds.c @@ -101,9 +101,7 @@ struct nsh_taskstatus_s FAR const char *td_flags; /* Thread flags */ FAR const char *td_priority; /* Thread priority */ FAR const char *td_policy; /* Thread scheduler */ -#ifndef CONFIG_DISABLE_SIGNALS FAR const char *td_sigmask; /* Signal mask */ -#endif }; /* Status strings */ @@ -131,10 +129,7 @@ static const char g_state[] = "State:"; static const char g_flags[] = "Flags:"; static const char g_priority[] = "Priority:"; static const char g_scheduler[] = "Scheduler:"; - -#ifndef CONFIG_DISABLE_SIGNALS static const char g_sigmask[] = "SigMask:"; -#endif #if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE) static const char g_stacksize[] = "StackSize:"; @@ -260,13 +255,10 @@ static void nsh_parse_statusline(FAR char *line, status->td_policy = nsh_trimspaces(&line[12+6]); } - -#ifndef CONFIG_DISABLE_SIGNALS else if (strncmp(line, g_sigmask, strlen(g_sigmask)) == 0) { status->td_sigmask = nsh_trimspaces(&line[12]); } -#endif } #endif @@ -334,9 +326,7 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath, status.td_flags = ""; status.td_priority = ""; status.td_policy = ""; -#ifndef CONFIG_DISABLE_SIGNALS status.td_sigmask = ""; -#endif /* Read the task status */ @@ -403,10 +393,7 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath, nsh_output(vtbl, "%3s %-8s %-7s %3s %-8s %-9s ", status.td_priority, status.td_policy, status.td_type, status.td_flags, status.td_state, status.td_event); - -#ifndef CONFIG_DISABLE_SIGNALS nsh_output(vtbl, "%-8s ", status.td_sigmask); -#endif #if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE) /* Get the StackSize and StackUsed */ @@ -596,10 +583,7 @@ int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) nsh_output(vtbl, "%3s %-8s %-7s %3s %-8s %-9s ", "PRI", "POLICY", "TYPE", "NPX", "STATE", "EVENT"); - -#ifndef CONFIG_DISABLE_SIGNALS nsh_output(vtbl, "%-8s ", "SIGMASK"); -#endif #if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE) nsh_output(vtbl, "%6s ", "STACK"); @@ -623,7 +607,6 @@ int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) * Name: cmd_kill ****************************************************************************/ -#ifndef CONFIG_DISABLE_SIGNALS #ifndef CONFIG_NSH_DISABLE_KILL int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { @@ -691,13 +674,11 @@ invalid_arg: return ERROR; } #endif -#endif /**************************************************************************** * Name: cmd_sleep ****************************************************************************/ -#ifndef CONFIG_DISABLE_SIGNALS #ifndef CONFIG_NSH_DISABLE_SLEEP int cmd_sleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { @@ -715,13 +696,11 @@ int cmd_sleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) return OK; } #endif -#endif /**************************************************************************** * Name: cmd_usleep ****************************************************************************/ -#ifndef CONFIG_DISABLE_SIGNALS #ifndef CONFIG_NSH_DISABLE_USLEEP int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { @@ -739,4 +718,3 @@ int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) return OK; } #endif -#endif diff --git a/system/composite/composite.h b/system/composite/composite.h index 299c931cd..5f721e83f 100644 --- a/system/composite/composite.h +++ b/system/composite/composite.h @@ -179,9 +179,9 @@ struct composite_state_s FAR void *cmphandle; /* Composite device handle */ +#ifndef CONFIG_NSH_BUILTIN_APPS /* Serial file descriptors */ -#if !defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_DISABLE_SIGNALS) int outfd; /* Blocking write-only */ int infd; /* Non-blockig read-only */ #endif @@ -198,7 +198,7 @@ struct composite_state_s /* Serial I/O buffer */ -#if !defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_DISABLE_SIGNALS) +#ifndef CONFIG_NSH_BUILTIN_APPS uint8_t serbuf[CONFIG_SYSTEM_COMPOSITE_BUFSIZE]; #endif }; diff --git a/system/composite/composite_main.c b/system/composite/composite_main.c index 99ef237d2..115544af9 100644 --- a/system/composite/composite_main.c +++ b/system/composite/composite_main.c @@ -64,7 +64,7 @@ #undef NEED_DUMPTRACE #ifdef CONFIG_USBDEV_TRACE -# if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS) +# if !defined(CONFIG_NSH_BUILTIN_APPS) # define NEED_DUMPTRACE 1 # elif CONFIG_USBDEV_TRACE_INITIALIDSET != 0 # define NEED_DUMPTRACE 1 @@ -397,7 +397,7 @@ static int dumptrace(void) * Name: open_serial ****************************************************************************/ -#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS) +#ifndef CONFIG_NSH_BUILTIN_APPS static int open_serial(void) { int errcode; @@ -622,13 +622,9 @@ int conn_main(int argc, char *argv[]) } #endif - /* It this program was configued as an NSH command, then just exit now. - * Also, if signals are not enabled (and, hence, sleep() is not supported. - * then we have not real option but to exit now. - */ - -#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS) + /* It this program was configued as an NSH command, then just exit now. */ +#ifndef CONFIG_NSH_BUILTIN_APPS /* Otherwise, this thread will hang around and monitor the USB activity */ /* Open the serial driver */ @@ -680,11 +676,9 @@ int conn_main(int argc, char *argv[]) /* Dump debug memory usage */ printf("conn_main: Exiting\n"); -#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS) +#ifndef CONFIG_NSH_BUILTIN_APPS close(g_composite.infd); close(g_composite.outfd); -#endif -#ifdef CONFIG_NSH_BUILTIN_APPS #endif final_memory_usage("Final memory usage"); return 0; @@ -693,7 +687,7 @@ int conn_main(int argc, char *argv[]) errout_bad_dump: #endif -#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS) +#ifndef CONFIG_NSH_BUILTIN_APPS errout: close(g_composite.infd); close(g_composite.outfd); diff --git a/system/sched_note/note_main.c b/system/sched_note/note_main.c index 3fb287979..08c694726 100644 --- a/system/sched_note/note_main.c +++ b/system/sched_note/note_main.c @@ -66,9 +66,7 @@ static FAR const char *g_statenames[] = "Running", "Inactive", "Waiting for Semaphore", -#ifndef CONFIG_DISABLE_SIGNALS "Waiting for Signal", -#endif #ifndef CONFIG_DISABLE_MQUEUE "Waiting for MQ empty", "Waiting for MQ full" diff --git a/system/usbmsc/usbmsc_main.c b/system/usbmsc/usbmsc_main.c index b8c33f411..04f970d8b 100644 --- a/system/usbmsc/usbmsc_main.c +++ b/system/usbmsc/usbmsc_main.c @@ -574,16 +574,12 @@ int msconn_main(int argc, char *argv[]) check_test_memory_usage("After usbmsc_exportluns()"); - /* It this program was configured as an NSH command, then just exit now. - * Also, if signals are not enabled (and, hence, sleep() is not supported. - * then we have not real option but to exit now. - */ - -#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS) + /* It this program was configured as an NSH command, then just exit now. */ +#ifndef CONFIG_NSH_BUILTIN_APPS /* Otherwise, this thread will hang around and monitor the USB storage activity */ - for (;;) + for (; ; ) { fflush(stdout); sleep(5); @@ -603,8 +599,8 @@ int msconn_main(int argc, char *argv[]) printf("mcsonn_main: Still alive\n"); # endif } -#elif defined(CONFIG_NSH_BUILTIN_APPS) +#else /* Return the USB mass storage device handle so it can be used by the 'msconn' * command. */ @@ -612,16 +608,6 @@ int msconn_main(int argc, char *argv[]) printf("mcsonn_main: Connected\n"); g_usbmsc.mshandle = handle; check_test_memory_usage("After MS connection"); - -#else /* defined(CONFIG_DISABLE_SIGNALS) */ - - /* Just exit */ - - printf("mcsonn_main: Exiting\n"); - - /* Dump debug memory usage */ - - final_memory_usage("Final memory usage"); #endif return EXIT_SUCCESS; diff --git a/testing/ostest/Kconfig b/testing/ostest/Kconfig index 48e88e079..beb9fb9f2 100644 --- a/testing/ostest/Kconfig +++ b/testing/ostest/Kconfig @@ -6,7 +6,6 @@ config TESTING_OSTEST tristate "OS test example" default n - depends on !DISABLE_SIGNALS ---help--- Enable the OS test example @@ -107,7 +106,7 @@ config TESTING_OSTEST_FPUSTACKSIZE default 2048 endif # !TESTING_OSTEST_FPUTESTDISABLE -endif # ARCH_FPU && SCHED_WAITPID && !DISABLE_SIGNALS +endif # ARCH_FPU && SCHED_WAITPID config TESTING_OSTEST_WAITRESULT bool "Wait and return test result" diff --git a/testing/ostest/Makefile b/testing/ostest/Makefile index 344565764..4ad4cee16 100644 --- a/testing/ostest/Makefile +++ b/testing/ostest/Makefile @@ -43,18 +43,15 @@ STACKSIZE = 2048 # NuttX OS Test -ASRCS = -CSRCS = dev_null.c restart.c sigprocmask.c +ASRCS = +CSRCS = dev_null.c restart.c sigprocmask.c sighand.c signest.c MAINSRC = ostest_main.c -ifneq ($(CONFIG_DISABLE_SIGNALS),y) -CSRCS += sighand.c signest.c ifeq ($(CONFIG_SIG_SIGSTOP_ACTION),y) ifeq ($(CONFIG_SIG_SIGKILL_ACTION),y) CSRCS += suspend.c endif endif -endif ifeq ($(CONFIG_ARCH_FPU),y) ifneq ($(CONFIG_TESTING_OSTEST_FPUTESTDISABLE),y) diff --git a/testing/ostest/cancel.c b/testing/ostest/cancel.c index 6aefb01fa..30817f1b3 100644 --- a/testing/ostest/cancel.c +++ b/testing/ostest/cancel.c @@ -221,7 +221,7 @@ static FAR void *mqueue_waiter(FAR void *parameter) } #endif -#if !defined(CONFIG_DISABLE_SIGNALS) && defined(CONFIG_CANCELLATION_POINTS) +#ifdef CONFIG_CANCELLATION_POINTS static FAR void *sig_waiter(FAR void *parameter) { struct siginfo info; @@ -707,7 +707,7 @@ void cancel_test(void) printf("cancel_test: Test 7: Cancel signal wait\n"); printf("cancel_test: Starting thread (cancelable)\n"); -#if !defined(CONFIG_DISABLE_SIGNALS) && defined(CONFIG_CANCELLATION_POINTS) +#ifdef CONFIG_CANCELLATION_POINTS /* Start the sig_waiter thread */ restart_thread(sig_waiter, &waiter, 0); diff --git a/testing/ostest/ostest.h b/testing/ostest/ostest.h index 4cd628fff..133c577dd 100644 --- a/testing/ostest/ostest.h +++ b/testing/ostest/ostest.h @@ -37,14 +37,6 @@ #ifndef __APPS_TESTING_OSTEST_OSTEST_H #define __APPS_TESTING_OSTEST_OSTEST_H -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifdef CONFIG_DISABLE_SIGNALS -# error Signals are disabled (CONFIG_DISABLE_SIGNALS) -#endif - /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/testing/ostest/ostest_main.c b/testing/ostest/ostest_main.c index a6a296756..61f58ad36 100644 --- a/testing/ostest/ostest_main.c +++ b/testing/ostest/ostest_main.c @@ -476,7 +476,6 @@ static int user_main(int argc, char *argv[]) sigprocmask_test(); check_test_memory_usage(); -#ifndef CONFIG_DISABLE_SIGNALS /* Verify signal handlers */ printf("\nuser_main: signal handler test\n"); @@ -492,7 +491,6 @@ static int user_main(int argc, char *argv[]) suspend_test(); check_test_memory_usage(); #endif -#endif #ifndef CONFIG_DISABLE_POSIX_TIMERS /* Verify posix timers (with SIGEV_SIGNAL) */