summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-28 12:50:28 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-03-28 12:50:28 +0100
commitc7571c02b18e0bb848fb1708fa83fc15ed296fc7 (patch)
tree588e56bcf7a1282fcbd3b8c42ee596892b470fa7 /src
parent8e42cb8c47496d2f537cad6c47f49205e55a1010 (diff)
downloadwolfbones-c7571c02b18e0bb848fb1708fa83fc15ed296fc7.tar.gz
wolfbones-c7571c02b18e0bb848fb1708fa83fc15ed296fc7.tar.bz2
fixed installation of SIGIO/SIGPOLL and SIGCLD/SIGCHLD
Diffstat (limited to 'src')
-rw-r--r--src/daemon/daemon.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index 7ce6152..6c76320 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -229,7 +229,7 @@ static wolf_error_t install_signal_handlers_parent( void ) {
SIGWINCH,
#endif
#if defined( SIGIO ) && defined( SIGPOLL )
-#if SIGIO != SIGPOLL
+#if SIGIO == SIGPOLL
SIGIO,
#else
#if defined( SIGPOLL )
@@ -238,7 +238,7 @@ static wolf_error_t install_signal_handlers_parent( void ) {
#if defined( SIGIO )
SIGIO,
#endif
-#endif /* SIGIO != SIGPOLL */
+#endif /* SIGIO == SIGPOLL */
#else
#if defined( SIGIO )
SIGIO,
@@ -260,7 +260,7 @@ static wolf_error_t install_signal_handlers_parent( void ) {
/* signals for empty handlers */
if( ( error = wolf_signal_install_empty(
#if defined( SIGCHLD ) && defined( SIGCLD )
-#if SIGCLD != SIGCHLD
+#if SIGCLD == SIGCHLD
SIGCHLD,
#else
#if defined( SIGCHLD )
@@ -269,7 +269,7 @@ static wolf_error_t install_signal_handlers_parent( void ) {
#if defined( SIGCLD )
SIGCLD,
#endif
-#endif /* SIGCLD != SIGCHLD */
+#endif /* SIGCLD == SIGCHLD */
#else
#if defined( SIGCHLD )
SIGCHLD,
@@ -342,18 +342,24 @@ wolf_error_t wolf_daemon_start( wolf_daemon_p d ) {
* We don't want that and we are installing empty signal handlers.
*/
#if defined( SIGCHLD ) && defined( SIGCLD )
-#if SIGCLD != SIGCHLD
+#if SIGCLD == SIGCHLD
wolf_signal_install_empty( SIGCLD, 0 );
- wolf_signal_install_empty( SIGCHLD, 0 );
#else
#if defined( SIGCHLD )
wolf_signal_install_empty( SIGCHLD, 0 );
#endif
#if defined( SIGCLD )
wolf_signal_install_empty( SIGCLD, 0 );
+#endif
+#endif /* SIGCLD == SIGCHLD */
+#else
+#if defined( SIGCHLD )
+ wolf_signal_install_empty( SIGCHLD, 0 );
#endif
-#endif
-#endif
+#if defined( SIGCLD )
+ wolf_signal_install_empty( SIGCLD, 0 );
+#endif
+#endif /* defined( SIGCHLD ) && defined( SIGCLD ) */
/* first pipe communicates from parent of daemon and daemon
* itself back to the grand-parent (exit codes).
@@ -423,18 +429,24 @@ wolf_error_t wolf_daemon_start( wolf_daemon_p d ) {
* We don't want that and we are installing empty signal handlers.
*/
#if defined( SIGCHLD ) && defined( SIGCLD )
-#if SIGCLD != SIGCHLD
+#if SIGCLD == SIGCHLD
wolf_signal_install_empty( SIGCLD, 0 );
- wolf_signal_install_empty( SIGCHLD, 0 );
#else
#if defined( SIGCHLD )
wolf_signal_install_empty( SIGCHLD, 0 );
#endif
#if defined( SIGCLD )
wolf_signal_install_empty( SIGCLD, 0 );
+#endif
+#endif /* SIGCLD == SIGCHLD */
+#else
+#if defined( SIGCHLD )
+ wolf_signal_install_empty( SIGCHLD, 0 );
#endif
-#endif
-#endif
+#if defined( SIGCLD )
+ wolf_signal_install_empty( SIGCLD, 0 );
+#endif
+#endif /* defined( SIGCHLD ) && defined( SIGCLD ) */
/* Now that the parent is process group leader, fork again. This
* way the final child can not inherit a controlling terminal
@@ -840,7 +852,7 @@ wolf_error_t wolf_daemon_signals_install_handlers( void ) {
SIGPOLL,
#endif
#if defined( SIGIO ) && defined( SIGPOLL )
-#if SIGIO != SIGPOLL
+#if SIGIO == SIGPOLL
SIGIO,
#else
#if defined( SIGPOLL )
@@ -849,7 +861,7 @@ wolf_error_t wolf_daemon_signals_install_handlers( void ) {
#if defined( SIGIO )
SIGIO,
#endif
-#endif /* SIGIO != SIGPOLL */
+#endif /* SIGIO == SIGPOLL */
#else
#if defined( SIGIO )
SIGIO,
@@ -866,7 +878,7 @@ wolf_error_t wolf_daemon_signals_install_handlers( void ) {
/* signals for empty handlers */
if( ( error = wolf_signal_install_empty(
#if defined( SIGCHLD ) && defined( SIGCLD )
-#if SIGCLD != SIGCHLD
+#if SIGCLD == SIGCHLD
SIGCHLD,
#else
#if defined( SIGCHLD )
@@ -875,7 +887,7 @@ wolf_error_t wolf_daemon_signals_install_handlers( void ) {
#if defined( SIGCLD )
SIGCLD,
#endif
-#endif /* SIGCLD != SIGCHLD */
+#endif /* SIGCLD == SIGCHLD */
#else
#if defined( SIGCHLD )
SIGCHLD,