OSDN Git Service

modified code to prevent DB inflation
[opengatem/opengatem.git] / mngsrc / signal.c
1 #include "opengatemmng.h"
2
3 /**********************************************************/
4 /* signal function WITHOUT SA_RESTART                     */
5 /**********************************************************/
6 Sigfunc* signalx(int signo, Sigfunc* func)
7 {
8   struct sigaction act, oldact;
9
10   act.sa_handler = func;
11   sigemptyset(&act.sa_mask);
12   act.sa_flags = 0;
13
14   if (sigaction(signo, &act, &oldact) < 0) return(SIG_ERR);
15         
16   return(oldact.sa_handler);
17 }
18