equal
deleted
inserted
replaced
89 peerpid = pid; |
89 peerpid = pid; |
90 peerpgid = (pgid <= 1 ? 0 : pgid); |
90 peerpgid = (pgid <= 1 ? 0 : pgid); |
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) |
102 goto error; |
106 goto error; |
103 |
107 |