added check for reliable signal handlers
This commit is contained in:
parent
c2576bd59e
commit
fb2d438abb
|
|
@ -52,6 +52,7 @@ from locktype import checkForLockingType
|
|||
from lamerpack import checkForLamerpack
|
||||
from debugmode import checkForDebugBuild
|
||||
from timeout import checkForClientTimeout
|
||||
from relsignals import checkReliableSignals
|
||||
|
||||
conf = Configure(env,{'checkForCCOption':checkForCCOption,
|
||||
'MAINTAINER_MODE':checkForMaintainerMode,
|
||||
|
|
@ -61,7 +62,8 @@ conf = Configure(env,{'checkForCCOption':checkForCCOption,
|
|||
'checkForLockingType':checkForLockingType,
|
||||
'checkForLamerPack':checkForLamerpack,
|
||||
'checkForDebugBuild':checkForDebugBuild,
|
||||
'checkForClientTimeout':checkForClientTimeout
|
||||
'checkForClientTimeout':checkForClientTimeout,
|
||||
'checkReliableSignals':checkReliableSignals
|
||||
})
|
||||
# check for CC options
|
||||
for option in Split("""
|
||||
|
|
@ -118,6 +120,8 @@ if not conf.CheckType("union semun", "#include <sys/types.h>\n#include <sys/ipc.
|
|||
conf.env.Append(CPPFLAGS = "-D_SEM_SEMUN_UNDEFINED=1")
|
||||
|
||||
conf.checkForLockingType(conf)
|
||||
if conf.checkReliableSignals():
|
||||
conf.env.Append(CPPFLAGS = '-DRELIABLE_SIGNALS')
|
||||
conf.checkForLockPrefix()
|
||||
PREFIX=conf.checkPrefix(PREFIX)
|
||||
conf.env.Append(CPPFLAGS = '-DSYSCONFDIR=\\"'+PREFIX+'/etc\\"')
|
||||
|
|
|
|||
40
site_scons/relsignals.py
Normal file
40
site_scons/relsignals.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#
|
||||
# SCons Reliable signals test
|
||||
#
|
||||
# Version 1.0
|
||||
# 24-Aug-2009
|
||||
#
|
||||
|
||||
def checkReliableSignals(conf):
|
||||
"""Returns true if signal handlers reinstalls themself"""
|
||||
conf.Message("Checking for reliable signals... ")
|
||||
rc,result = conf.TryRun('''
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
volatile int test;
|
||||
void sig_handler(int sg)
|
||||
{
|
||||
test=1;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
signal(SIGUSR1,sig_handler);
|
||||
test=0;
|
||||
kill(getpid(),SIGUSR1);
|
||||
sleep(1);
|
||||
if(test==0) {
|
||||
printf("Signals ARE BROKEN!\\n");
|
||||
kill(0,SIGQUIT);
|
||||
}
|
||||
test=0;
|
||||
kill(getpid(),SIGUSR1);
|
||||
if(test==1)
|
||||
exit(0);
|
||||
else
|
||||
exit(1);
|
||||
}
|
||||
''','.c')
|
||||
conf.Result(rc)
|
||||
return rc
|
||||
Loading…
Reference in New Issue
Block a user