if (signo == SIGUSR1) {
fprintf(stderr, "[%s] Received SIGUSR1!\n", "process1");
}
- else if (signo == SIGQUIT) {
- fprintf(stderr, "[%s] Received SIGQUIT!\n", "process1");
+ else if (signo == SIGTERM) {
+ fprintf(stderr, "[%s] Received SIGTERM!\n", "process1");
fprintf(stderr, "[%s] > Releasing resources\n", "process1");
close(write_pipe);
unlink(write_pipe);
if (signal(SIGUSR1, sig_handler) == SIG_ERR) {
fprintf(stderr, "can't catch SIGUSR1\n");
}
- if (signal(SIGQUIT, sig_handler) == SIG_ERR) {
- fprintf(stderr, "can't catch SIGQUIT\n");
+ if (signal(SIGTERM, sig_handler) == SIG_ERR) {
+ fprintf(stderr, "can't catch SIGTERM\n");
}
if (signal(SIGINT, sig_handler) == SIG_ERR) {
fprintf(stderr, "can't catch SIGINT\n");
if (signo == SIGUSR1) {
fprintf(stderr, "[%s] Received SIGUSR1!\n", "process2");
}
- else if (signo == SIGQUIT) {
- fprintf(stderr, "[%s] Received SIGQUIT!\n", "process2");
+ else if (signo == SIGTERM) {
+ fprintf(stderr, "[%s] Received SIGTERM!\n", "process2");
fprintf(stderr, "[%s] > Releasing resources\n", "process2");
close(read_descriptor);
close(write_descriptor);
if (signal(SIGUSR1, sig_handler) == SIG_ERR) {
fprintf(stderr, "can't catch SIGUSR1\n");
}
- if (signal(SIGQUIT, sig_handler) == SIG_ERR) {
- fprintf(stderr, "can't catch SIGQUIT\n");
+ if (signal(SIGTERM, sig_handler) == SIG_ERR) {
+ fprintf(stderr, "can't catch SIGTERM\n");
}
if (signal(SIGINT, sig_handler) == SIG_ERR) {
fprintf(stderr, "can't catch SIGINT\n");
if (signo == SIGUSR1) {
fprintf(stderr, "[%s] Received SIGUSR1!\n", "process3");
}
- else if (signo == SIGQUIT) {
- fprintf(stderr, "[%s] Received SIGQUIT!\n", "process3");
+ else if (signo == SIGTERM) {
+ fprintf(stderr, "[%s] Received SIGTERM!\n", "process3");
fprintf(stderr, "[%s] > Releasing resources\n", "process3");
close(read_descriptor);
exit(0);
if (signal(SIGUSR1, sig_handler) == SIG_ERR) {
fprintf(stderr, "can't catch SIGUSR1\n");
}
- if (signal(SIGQUIT, sig_handler) == SIG_ERR) {
- fprintf(stderr, "can't catch SIGQUIT\n");
+ if (signal(SIGTERM, sig_handler) == SIG_ERR) {
+ fprintf(stderr, "can't catch SIGTERM\n");
}
if (signal(SIGINT, sig_handler) == SIG_ERR) {
fprintf(stderr, "can't catch SIGINT\n");