@@ -74,10 +74,14 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
7474 FAR char * * argv ,
7575 FAR const struct nsh_param_s * param )
7676{
77- #if !defined(CONFIG_NSH_DISABLEBG ) && defined(CONFIG_SCHED_CHILD_STATUS )
77+ #if !defined(CONFIG_NSH_DISABLEBG ) && defined(CONFIG_SCHED_CHILD_STATUS ) && \
78+ defined(CONFIG_ENABLE_ALL_SIGNALS )
7879 struct sigaction act ;
7980 struct sigaction old ;
80- #endif
81+ #endif /* !CONFIG_NSH_DISABLEBG && CONFIG_SCHED_CHILD_STATUS &&
82+ * CONFIG_ENABLE_ALL_SIGNALS
83+ */
84+
8185 int ret = OK ;
8286
8387 /* Lock the scheduler in an attempt to prevent the application from
@@ -86,7 +90,8 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
8690
8791 sched_lock ();
8892
89- #if !defined(CONFIG_NSH_DISABLEBG ) && defined(CONFIG_SCHED_CHILD_STATUS )
93+ #if !defined(CONFIG_NSH_DISABLEBG ) && \
94+ defined(CONFIG_SCHED_CHILD_STATUS ) && defined(CONFIG_ENABLE_ALL_SIGNALS )
9095 /* Ignore the child status if run the application on background. */
9196
9297 if (vtbl -> np .np_bg == true)
@@ -98,7 +103,9 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
98103 sigaction (SIGCHLD , & act , & old );
99104 }
100105
101- #endif /* CONFIG_NSH_DISABLEBG */
106+ #endif /* !CONFIG_NSH_DISABLEBG && !CONFIG_SCHED_CHILD_STATUS &&
107+ * CONFIG_ENABLE_ALL_SIGNALS
108+ */
102109
103110 /* Try to find and execute the command within the list of builtin
104111 * applications.
@@ -230,7 +237,8 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
230237
231238#if !defined(CONFIG_SCHED_WAITPID ) || !defined(CONFIG_NSH_DISABLEBG )
232239 {
233- #if !defined(CONFIG_NSH_DISABLEBG ) && defined(CONFIG_SCHED_CHILD_STATUS )
240+ #if !defined(CONFIG_NSH_DISABLEBG ) && defined(CONFIG_SCHED_CHILD_STATUS ) && \
241+ defined(CONFIG_ENABLE_ALL_SIGNALS )
234242
235243 /* Restore the old actions */
236244
@@ -241,7 +249,10 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
241249 sigaction (SIGCHLD , & old , NULL );
242250 }
243251
244- # endif
252+ # endif /* !CONFIG_NSH_DISABLEBG && CONFIG_SCHED_CHILD_STATUS && \
253+ * CONFIG_ENABLE_ALL_SIGNALS
254+ */
255+
245256 struct sched_param sched ;
246257 sched_getparam (ret , & sched );
247258 nsh_output (vtbl , "%s [%d:%d]\n" , cmd , ret , sched .sched_priority );
0 commit comments