Dr.Knowitall
Dr.Knowitall

Reputation: 10508

How do i remove a signal handler

I've made the follow signal handler

struct sigaction pipeIn;
pipeIn.sa_handler = updateServer;
sigemptyset(&pipeIn.sa_mask);
sa.sa_flags = SA_RESTART;

if(sigaction(SIGUSR1, &pipeIn, NULL) == -1){

    printf("We have a problem, sigaction is not working.\n");
    perror("\n");
    exit(1);    

}

How do I remove or block this particular handler so that I can set up another signal handler that uses the same signal? Thanks.

Upvotes: 16

Views: 12661

Answers (1)

Nikolai Fetissov
Nikolai Fetissov

Reputation: 84239

Use SIG_DFL in place of the function pointer when calling sigaction(2).

Upvotes: 21

Related Questions