- /* handle some signale */
- installsignal(SIGINT, "INT");
- installsignal(SIGHUP, "HUP");
- installsignal(SIGQUIT, "QUIT");
- installsignal(SIGTERM, "TERM");
- installsignal(SIGCHLD, "CHLD");
+ /* handle some signals */
+ bzero(&sact, sizeof(sact));
+ sigemptyset(&sact.sa_mask);
+ sact.sa_flags = 0;
+ sact.sa_handler = sighdlr;
+ sigaction(SIGINT, &sact, NULL);
+ sigaction(SIGQUIT, &sact, NULL);
+ sigaction(SIGTERM, &sact, NULL);
+ sigaction(SIGHUP, &sact, NULL);
+
+ sact.sa_handler = sighdlr;
+ sact.sa_flags = SA_NOCLDSTOP;
+ sigaction(SIGCHLD, &sact, NULL);