mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
iucvterm/iucvtty: Close PTY slave fd after fork
The PTY slave file descriptor is the controlling terminal allocated for the child process. When all file descriptors are being closed, a SIGHUP is triggered for the child process. Keeping the file descriptor in the parent open would prevent the SIGHUP to be delivered to the child process. For proper SIGHUP processing, close the file descriptor in the parent process. Acked-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
c85b4e54dd
commit
a69a46eafd
@@ -123,6 +123,9 @@ static int iucvtty_worker(int client, int master, int slave,
|
||||
exit(3); /* we only reach here if exec has failed */
|
||||
}
|
||||
|
||||
/* Close slave fd to properly handle SIGHUP for the child process */
|
||||
close(slave);
|
||||
|
||||
/* setup buffers */
|
||||
msg = malloc(MSG_BUFFER_SIZE);
|
||||
if (msg == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user