##// END OF EJS Templates
chg: document why we send SIGHUP and SIGINT to process group...
Jun Wu -
r31229:68c94f28 default
parent child Browse files
Show More
@@ -91,11 +91,15 b' void setupsignalhandler(pid_t pid, pid_t'
91
91
92 struct sigaction sa;
92 struct sigaction sa;
93 memset(&sa, 0, sizeof(sa));
93 memset(&sa, 0, sizeof(sa));
94
95 /* deadly signals meant to be sent to a process group:
96 * - SIGHUP: usually generated by the kernel, when termination of a
97 * process causes that process group to become orphaned
98 * - SIGINT: usually generated by the terminal */
94 sa.sa_handler = forwardsignaltogroup;
99 sa.sa_handler = forwardsignaltogroup;
95 sa.sa_flags = SA_RESTART;
100 sa.sa_flags = SA_RESTART;
96 if (sigemptyset(&sa.sa_mask) < 0)
101 if (sigemptyset(&sa.sa_mask) < 0)
97 goto error;
102 goto error;
98
99 if (sigaction(SIGHUP, &sa, NULL) < 0)
103 if (sigaction(SIGHUP, &sa, NULL) < 0)
100 goto error;
104 goto error;
101 if (sigaction(SIGINT, &sa, NULL) < 0)
105 if (sigaction(SIGINT, &sa, NULL) < 0)
General Comments 0
You need to be logged in to leave comments. Login now