From 686bcfadc73563ec3505ee8bb4c2be8f4c6f83ec Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Thu, 9 Aug 2012 12:24:56 -0600 Subject: [PATCH] Use SIGCHLD rather than SIGCLD. Patch from Pascal Stumpf The official POSIX name for this signal is SIGCHLD. Linux probably has SIGCLD only for SysV compatibility, but BSD does not. --- cde/programs/dtexec/Main.c | 4 ++-- cde/programs/dtpad/main.c | 4 ++-- cde/programs/dtpdmd/dtpdmd.c | 2 +- cde/programs/dtpdmd/records.c | 4 ++-- cde/programs/dtsession/SmRestore.c | 12 ++++++------ cde/programs/dtwm/WmFunction.c | 2 +- cde/programs/dtwm/WmResParse.c | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cde/programs/dtexec/Main.c b/cde/programs/dtexec/Main.c index a062203e..3c359f00 100644 --- a/cde/programs/dtexec/Main.c +++ b/cde/programs/dtexec/Main.c @@ -538,7 +538,7 @@ InitializeSignalHandling( void ) sigemptyset(&svec.sa_mask); svec.sa_flags = 0; svec.sa_handler = SigCld; - (void) sigaction(SIGCLD, &svec, (struct sigaction *) NULL); + (void) sigaction(SIGCHLD, &svec, (struct sigaction *) NULL); /* * "Urgent Signal" handlers @@ -667,7 +667,7 @@ ExecuteCommand ( svec.sa_handler = SIG_DFL; /* Normal */ - (void) sigaction(SIGCLD, &svec, (struct sigaction *) NULL); + (void) sigaction(SIGCHLD, &svec, (struct sigaction *) NULL); /* Urgent */ (void) sigaction(SIGTERM, &svec, (struct sigaction *) NULL); diff --git a/cde/programs/dtpad/main.c b/cde/programs/dtpad/main.c index 930cb69e..0691e891 100644 --- a/cde/programs/dtpad/main.c +++ b/cde/programs/dtpad/main.c @@ -985,7 +985,7 @@ InitEditSessionAndFirstPad( sigfillset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SigcldHndlr; - sigaction(SIGCLD, &act, (struct sigaction *)NULL); + sigaction(SIGCHLD, &act, (struct sigaction *)NULL); } } @@ -1591,7 +1591,7 @@ void SigcldHndlr (int dummy) /* * Is this really necessary? */ - sigaction(SIGCLD, &act, (struct sigaction *)NULL); + sigaction(SIGCHLD, &act, (struct sigaction *)NULL); } diff --git a/cde/programs/dtpdmd/dtpdmd.c b/cde/programs/dtpdmd/dtpdmd.c index 5489893c..6ea9795d 100644 --- a/cde/programs/dtpdmd/dtpdmd.c +++ b/cde/programs/dtpdmd/dtpdmd.c @@ -383,7 +383,7 @@ main( argc, argv ) sigemptyset(&svec.sa_mask); svec.sa_flags = 0; svec.sa_handler = handle_SIGCLD; - (void) sigaction(SIGCLD, &svec, (struct sigaction *) NULL); + (void) sigaction(SIGCHLD, &svec, (struct sigaction *) NULL); /* * After this point, we need to trap all X and XIO errors. diff --git a/cde/programs/dtpdmd/records.c b/cde/programs/dtpdmd/records.c index ddc80ea5..380a5b0f 100644 --- a/cde/programs/dtpdmd/records.c +++ b/cde/programs/dtpdmd/records.c @@ -55,7 +55,7 @@ static void block_SIGCLD( void ) int rtn; sigemptyset( &newset ); - sigaddset( &newset, SIGCLD ); + sigaddset( &newset, SIGCHLD ); rtn = sigprocmask( SIG_BLOCK, &newset, (sigset_t *) NULL ); } @@ -65,7 +65,7 @@ static void unblock_SIGCLD( void ) int rtn; sigemptyset( &newset ); - sigaddset( &newset, SIGCLD ); + sigaddset( &newset, SIGCHLD ); rtn = sigprocmask( SIG_UNBLOCK, &newset, (sigset_t *) NULL ); } diff --git a/cde/programs/dtsession/SmRestore.c b/cde/programs/dtsession/SmRestore.c index aa314cf8..7fb200c3 100644 --- a/cde/programs/dtsession/SmRestore.c +++ b/cde/programs/dtsession/SmRestore.c @@ -473,11 +473,11 @@ SystemCmd (char *pchCmd) { void (*signalHandler) (); - signalHandler = (void (*)())signal (SIGCLD, SIG_DFL); + signalHandler = (void (*)())signal (SIGCHLD, SIG_DFL); system (pchCmd); - signal (SIGCLD, signalHandler); + signal (SIGCHLD, signalHandler); } /* END OF FUNTION SystemCmd */ @@ -896,7 +896,7 @@ RestoreResources( Boolean errorHandlerInstalled, ... ) setegid(smGD.runningGID); #endif #endif -#ifdef __osf__ +#if defined(__osf__) || defined(CSRG_BASED) setsid(); #else (void) setpgrp(); @@ -3607,7 +3607,7 @@ StartLocalClient ( _DtEnvControl(DT_ENV_RESTORE_PRE_DT); -#ifdef __osf__ +#if defined(__osf__) || defined(CSRG_BASED) setsid(); #else (void)setpgrp(); @@ -3843,7 +3843,7 @@ ForkWM( void ) #endif _DtEnvControl(DT_ENV_RESTORE_PRE_DT); -#ifdef __osf__ +#if defined(__osf__) || defined(CSRG_BASED) setsid(); #else (void)setpgrp(); @@ -3928,7 +3928,7 @@ KillParent( void ) /* * Disassociate from parent */ -#ifdef __osf__ +#if defined(__osf__) || defined(CSRG_BASED) setsid(); #else setpgrp(); diff --git a/cde/programs/dtwm/WmFunction.c b/cde/programs/dtwm/WmFunction.c index c8e9b5b3..22a9d56c 100644 --- a/cde/programs/dtwm/WmFunction.c +++ b/cde/programs/dtwm/WmFunction.c @@ -108,7 +108,7 @@ static unsigned int GetEventInverseMask(XEvent *event); #ifdef WSM -#if (defined(USL) || defined(__uxp__) || defined(linux)) && !defined(_NFILE) +#if (defined(USL) || defined(__uxp__) || defined(linux) || defined(CSRG_BASED)) && !defined(_NFILE) #define _NFILE FOPEN_MAX #endif #define CLOSE_FILES_ON_EXEC() \ diff --git a/cde/programs/dtwm/WmResParse.c b/cde/programs/dtwm/WmResParse.c index 0331c369..a0630a02 100644 --- a/cde/programs/dtwm/WmResParse.c +++ b/cde/programs/dtwm/WmResParse.c @@ -7504,11 +7504,11 @@ SystemCmd (char *pchCmd) sa.sa_flags = 0; sa.sa_handler = SIG_DFL; - (void) sigaction (SIGCLD, &sa, &osa); + (void) sigaction (SIGCHLD, &sa, &osa); system (pchCmd); - (void) sigaction (SIGCLD, &osa, (struct sigaction *) 0); + (void) sigaction (SIGCHLD, &osa, (struct sigaction *) 0); } -- 2.25.1