--- MITgcm/eesupp/src/sigreg.c 2005/12/04 13:57:08 1.2 +++ MITgcm/eesupp/src/sigreg.c 2006/05/22 22:05:18 1.3 @@ -1,5 +1,5 @@ /* - * $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/src/sigreg.c,v 1.2 2005/12/04 13:57:08 edhill Exp $ + * $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/src/sigreg.c,v 1.3 2006/05/22 22:05:18 edhill Exp $ * $Name: $ //BOP @@ -19,32 +19,38 @@ /* #define FC_NAMEMANGLE(X) X ## _ */ +#ifdef HAVE_SIGREG #include #include #include #include #include +#endif int * ip; +#ifdef HAVE_SIGREG static void killhandler( unsigned int sn, siginfo_t si, struct ucontext *sc ) { *ip = *ip + 1; return; } +#endif /* int main( int argc, char ** argv ) */ void FC_NAMEMANGLE(sigreg) (int * aip) { - struct sigaction s; ip = aip; +#ifdef HAVE_SIGREG + struct sigaction s; s.sa_flags = SA_SIGINFO; s.sa_sigaction = (void *)killhandler; if(sigaction (SIGTERM,&s,(struct sigaction *)NULL)) { printf("Sigaction returned error = %d\n", errno); exit(0); } +#endif return; }