From bc6f7792f8c5ef6dc6d87ca851c1e182c6a0e418 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 4 Apr 2008 22:01:31 +0000 Subject: * include/bsdsignal.h: Include . (OPENAXIOM_SIGCHLD): New macro. * hyper/hyper.c (main): Use OPENAXIOM_SIGCHLD. * graph/viewman/viewman.c: Don't include directly. (main): Use OPENAXIOM_SIGCHLD. * graph/viewman/sselect.c: Don't include directly. (superSelect): Tidy. Use OPENAXIOM_SIGCHLD. --- src/ChangeLog | 10 ++++++++++ src/graph/viewman/sselect.c | 14 +------------- src/graph/viewman/viewman.c | 11 +---------- src/hyper/hyper.c | 6 +----- src/include/bsdsignal.h | 8 ++++++++ src/lib/fnct_key.c | 8 +------- 6 files changed, 22 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index cddbd22d..1d8a5b18 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2008-04-04 Gabriel Dos Reis + + * include/bsdsignal.h: Include . + (OPENAXIOM_SIGCHLD): New macro. + * hyper/hyper.c (main): Use OPENAXIOM_SIGCHLD. + * graph/viewman/viewman.c: Don't include directly. + (main): Use OPENAXIOM_SIGCHLD. + * graph/viewman/sselect.c: Don't include directly. + (superSelect): Tidy. Use OPENAXIOM_SIGCHLD. + 2008-04-04 Gabriel Dos Reis * lib/Makefile.in (libopen_axiom_core_objects): Tidy. diff --git a/src/graph/viewman/sselect.c b/src/graph/viewman/sselect.c index a9b16528..96516be2 100644 --- a/src/graph/viewman/sselect.c +++ b/src/graph/viewman/sselect.c @@ -40,7 +40,6 @@ #include #include #include -#include #include "viewman.h" #include "bsdsignal.h" @@ -61,14 +60,7 @@ *******************************************/ int -#ifdef _NO_PROTO -superSelect(n, rd, wr, ex, timeout) - int n; - int *rd, *wr, *ex; - char *timeout; -#else superSelect(int n, int *rd, int *wr, int *ex, char *timeout) -#endif { int waiting; @@ -89,11 +81,7 @@ superSelect(int n, int *rd, int *wr, int *ex, char *timeout) /* flush(spadSock); */ /* send_int(spadSock,1); acknowledge to spad */ checkClosedChild = no; -#if defined(BSDplatform) || defined(MACOSXplatform) - bsdSignal(SIGCHLD,endChild,DontRestartSystemCalls); -#else - bsdSignal(SIGCLD,endChild,DontRestartSystemCalls); -#endif + bsdSignal(OPENAXIOM_SIGCHLD,endChild,DontRestartSystemCalls); } } ret_val = select(n, (void *)rd, (void *)wr, (void *)ex, (void *)timeout); diff --git a/src/graph/viewman/viewman.c b/src/graph/viewman/viewman.c index aaacef25..96a6e13f 100644 --- a/src/graph/viewman/viewman.c +++ b/src/graph/viewman/viewman.c @@ -41,7 +41,6 @@ #include #include #include -#include #include "viewman.h" #include "mode.h" #include "actions.h" @@ -86,22 +85,14 @@ char *s1, int -#ifdef _NO_PROTO -main () -#else main (void) -#endif { graphStruct *aGraph; int keepLooking,code; bsdSignal(SIGPIPE,brokenPipe,DontRestartSystemCalls); -#if defined(BSDplatform) || defined (MACOSXplatform) - bsdSignal(SIGCHLD,endChild,RestartSystemCalls); -#else - bsdSignal(SIGCLD,endChild,RestartSystemCalls); -#endif + bsdSignal(OPENAXIOM_SIGCHLD,endChild,RestartSystemCalls); bsdSignal(SIGTERM,goodbye,DontRestartSystemCalls); /* Connect up to AXIOM server */ diff --git a/src/hyper/hyper.c b/src/hyper/hyper.c index ef00c891..152ccc35 100644 --- a/src/hyper/hyper.c +++ b/src/hyper/hyper.c @@ -258,11 +258,7 @@ main(int argc, char **argv) */ bsdSignal(SIGUSR2, sigusr2_handler,RestartSystemCalls); bsdSignal(SIGUSR1, SIG_IGN,RestartSystemCalls); -#if defined(BSDplatform) || defined(MACOSXplatform) - bsdSignal(SIGCHLD, sigcld_handler,RestartSystemCalls); -#else - bsdSignal(SIGCLD, sigcld_handler,RestartSystemCalls); -#endif + bsdSignal(OPENAXIOM_SIGCHLD, sigcld_handler,RestartSystemCalls); bsdSignal(SIGINT, SIG_IGN,RestartSystemCalls); /* diff --git a/src/include/bsdsignal.h b/src/include/bsdsignal.h index 5b724bbf..1a55293c 100644 --- a/src/include/bsdsignal.h +++ b/src/include/bsdsignal.h @@ -38,6 +38,14 @@ #include "open-axiom.h" +#include + +#ifdef SIGCHLD +# define OPENAXIOM_SIGCHLD SIGCHLD +#elif defined (SIGCLD) +# define OPENAXIOM_SIGCHLD SIGCLD +#endif + #define RestartSystemCalls 1 #define DontRestartSystemCalls 0 diff --git a/src/lib/fnct_key.c b/src/lib/fnct_key.c index c9240fd6..9e9e08f2 100644 --- a/src/lib/fnct_key.c +++ b/src/lib/fnct_key.c @@ -44,8 +44,6 @@ #include #include #include -#include - #include "edible.h" #include "bsdsignal.h" @@ -309,11 +307,7 @@ handle_function_key(int key,int chann) close(fd); } } -#if defined(MACOSXplatform) || defined(BSDplatform) - bsdSignal(SIGCHLD, null_fnct,RestartSystemCalls); -#else - bsdSignal(SIGCLD, null_fnct,RestartSystemCalls); -#endif + bsdSignal(OPENAXIOM_SIGCHLD, null_fnct,RestartSystemCalls); switch (id = fork()) { case -1: perror("Special key"); -- cgit v1.2.3