|
@@ -12,10 +12,15 @@ int pyfcgi_stats_init()
|
12
|
12
|
{
|
13
|
13
|
struct sigaction act;
|
14
|
14
|
struct itimerspec timeout;
|
|
15
|
+ struct sigevent sev;
|
15
|
16
|
|
16
|
17
|
memset(&pyfcgi_stats, 0, sizeof(pyfcgi_stats_t));
|
17
|
18
|
|
18
|
|
- if(timer_create(CLOCK_REALTIME, NULL, &(pyfcgi_stats.timerid)) < 0)
|
|
19
|
+ sev.sigev_notify = SIGEV_SIGNAL;
|
|
20
|
+ sev.sigev_signo = PYFCGI_STATS_SIGALRM;
|
|
21
|
+ sev.sigev_value.sival_int = 0;
|
|
22
|
+
|
|
23
|
+ if(timer_create(CLOCK_REALTIME, &sev, &(pyfcgi_stats.timerid)) < 0)
|
19
|
24
|
{
|
20
|
25
|
pyfcgi_log(LOG_ERR,
|
21
|
26
|
"Unable to create timer for stats collecting : %s",
|
|
@@ -27,7 +32,7 @@ int pyfcgi_stats_init()
|
27
|
32
|
sigemptyset(&act.sa_mask);
|
28
|
33
|
act.sa_flags = 0;
|
29
|
34
|
act.sa_restorer = NULL;
|
30
|
|
- if(sigaction(SIGALRM, &act, &(pyfcgi_stats.oldact)) < 0)
|
|
35
|
+ if(sigaction(PYFCGI_STATS_SIGALRM, &act, &(pyfcgi_stats.oldact)) < 0)
|
31
|
36
|
{
|
32
|
37
|
pyfcgi_log(LOG_ERR,
|
33
|
38
|
"Unable to register signal handler for stats collecting : %s",
|