mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
ksysguard: catch SIGTERM, SIGHUP and SIGINT from ksysgruardd
interesting thing is that there is a declaration of signalHandler() function but it was nowhere to be found, what happened to it? Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
ad62b07fea
commit
0883607c14
1 changed files with 11 additions and 0 deletions
|
@ -193,6 +193,13 @@ static void dropPrivileges( void )
|
|||
}
|
||||
}
|
||||
|
||||
void signalHandler( int sig )
|
||||
{
|
||||
log_error( "Signal caught: %d", sig );
|
||||
signal(sig, SIG_DFL);
|
||||
QuitApp = 1;
|
||||
}
|
||||
|
||||
void makeDaemon( void )
|
||||
{
|
||||
int fd = -1;
|
||||
|
@ -543,6 +550,10 @@ int main( int argc, char* argv[] )
|
|||
|
||||
initModules();
|
||||
|
||||
signal(SIGTERM, signalHandler);
|
||||
signal(SIGHUP, signalHandler);
|
||||
signal(SIGINT, signalHandler);
|
||||
|
||||
if ( RunAsDaemon ) {
|
||||
makeDaemon();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue