From 5215df9192d5a8a8785525552c3da9e0c96029d7 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sat, 18 Aug 2001 15:18:56 +0000 Subject: [PATCH] * main.c (init_sigchld): Disable subshell if SIGCHLD handler cannot be installed. --- src/ChangeLog | 3 +++ src/main.c | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 63afecec7..790eaf853 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2001-08-18 Pavel Roskin + * main.c (init_sigchld): Disable subshell if SIGCHLD handler + cannot be installed. + * x.h: Instead of undefining MIX and MAX after make sure that is included before . diff --git a/src/main.c b/src/main.c index 3d0a92937..a0648ea1f 100644 --- a/src/main.c +++ b/src/main.c @@ -2450,18 +2450,26 @@ init_sigchld (void) sigchld_action.sa_handler = #ifdef HAVE_SUBSHELL_SUPPORT use_subshell ? sigchld_handler : -#endif +#endif /* HAVE_SUBSHELL_SUPPORT */ sigchld_handler_no_subshell; sigemptyset (&sigchld_action.sa_mask); #ifdef SA_RESTART - sigchld_action.sa_flags = SA_RESTART; + sigchld_action.sa_flags = SA_RESTART; #else - sigchld_action.sa_flags = 0; -#endif + sigchld_action.sa_flags = 0; +#endif /* !SA_RESTART */ - sigaction (SIGCHLD, &sigchld_action, NULL); + if (sigaction (SIGCHLD, &sigchld_action, NULL) == -1) { +#ifdef HAVE_SUBSHELL_SUPPORT + /* + * This may happen on QNX Neutrino 6, where SA_RESTART + * is defined but not implemented. Fallback to no subshell. + */ + use_subshell = 0; +#endif /* HAVE_SUBSHELL_SUPPORT */ + } } #endif /* _OS_NT, __os2__, UNIX */