mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00
job-control: set CLOEXEC on pty processes. #5986
Before this change, new processes started with libuv prevented SIGHUP from reaching pty processes (by keeping the ptmx file descriptor open).
This commit is contained in:

committed by
Justin M. Keyes

parent
ad1884be0d
commit
f6946c68ae
@@ -1742,16 +1742,11 @@ failed:
|
||||
}
|
||||
# endif
|
||||
|
||||
if (!read_buffer && !read_stdin)
|
||||
close(fd); /* errors are ignored */
|
||||
#ifdef HAVE_FD_CLOEXEC
|
||||
else {
|
||||
int fdflags = fcntl(fd, F_GETFD);
|
||||
if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) {
|
||||
(void)fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC);
|
||||
}
|
||||
if (!read_buffer && !read_stdin) {
|
||||
close(fd); // errors are ignored
|
||||
} else {
|
||||
(void)os_set_cloexec(fd);
|
||||
}
|
||||
#endif
|
||||
xfree(buffer);
|
||||
|
||||
if (read_stdin) {
|
||||
|
Reference in New Issue
Block a user