Back to index

php5  5.3.10
Functions | Variables
fpm_signals.h File Reference
#include <signal.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int fpm_signals_init_main ()
int fpm_signals_init_child ()
int fpm_signals_get_fd ()

Variables

const char * fpm_signal_names [NSIG+1]

Function Documentation

Definition at line 246 of file fpm_signals.c.

{
       return sp[0];
}

Here is the caller graph for this function:

Definition at line 217 of file fpm_signals.c.

{
       struct sigaction act, act_dfl;

       memset(&act, 0, sizeof(act));
       memset(&act_dfl, 0, sizeof(act_dfl));

       act.sa_handler = &sig_soft_quit;
       act.sa_flags |= SA_RESTART;

       act_dfl.sa_handler = SIG_DFL;

       close(sp[0]);
       close(sp[1]);

       if (0 > sigaction(SIGTERM,  &act_dfl,  0) ||
           0 > sigaction(SIGINT,   &act_dfl,  0) ||
           0 > sigaction(SIGUSR1,  &act_dfl,  0) ||
           0 > sigaction(SIGUSR2,  &act_dfl,  0) ||
           0 > sigaction(SIGCHLD,  &act_dfl,  0) ||
           0 > sigaction(SIGQUIT,  &act,      0)) {

              zlog(ZLOG_SYSERROR, "failed to init child signals: sigaction()");
              return -1;
       }
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 180 of file fpm_signals.c.

{
       struct sigaction act;

       if (0 > socketpair(AF_UNIX, SOCK_STREAM, 0, sp)) {
              zlog(ZLOG_SYSERROR, "failed to init signals: socketpair()");
              return -1;
       }

       if (0 > fd_set_blocked(sp[0], 0) || 0 > fd_set_blocked(sp[1], 0)) {
              zlog(ZLOG_SYSERROR, "failed to init signals: fd_set_blocked()");
              return -1;
       }

       if (0 > fcntl(sp[0], F_SETFD, FD_CLOEXEC) || 0 > fcntl(sp[1], F_SETFD, FD_CLOEXEC)) {
              zlog(ZLOG_SYSERROR, "falied to init signals: fcntl(F_SETFD, FD_CLOEXEC)");
              return -1;
       }

       memset(&act, 0, sizeof(act));
       act.sa_handler = sig_handler;
       sigfillset(&act.sa_mask);

       if (0 > sigaction(SIGTERM,  &act, 0) ||
           0 > sigaction(SIGINT,   &act, 0) ||
           0 > sigaction(SIGUSR1,  &act, 0) ||
           0 > sigaction(SIGUSR2,  &act, 0) ||
           0 > sigaction(SIGCHLD,  &act, 0) ||
           0 > sigaction(SIGQUIT,  &act, 0)) {

              zlog(ZLOG_SYSERROR, "failed to init signals: sigaction()");
              return -1;
       }
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char* fpm_signal_names[NSIG+1]

Definition at line 25 of file fpm_signals.c.