Logo Search packages:      
Sourcecode: waimea version File versions  Download package

signalhandler ( int  sig  ) 

Signal handler function.

When one of the signals we handle arrives this function is called. Depending on what type of signal we received we do something, ex. restart, exit.

Parameters:
sig The signal we received

Definition at line 348 of file Waimea.cc.

References restart().

                            {
    int status;
    
    switch(sig) {
        case SIGINT:
        case SIGTERM:
            quit(EXIT_SUCCESS);
            break;
        case SIGHUP:
            restart(NULL);
            break;
        case SIGCHLD:
            waitpid(-1, &status, WNOHANG | WUNTRACED);
            break;
        default:
            quit(EXIT_FAILURE);
    }
}


Generated by  Doxygen 1.6.0   Back to index