aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memfile.c
diff options
context:
space:
mode:
authorMatthew Malcomson <hardenedapple@gmail.com>2017-01-21 14:11:30 +0000
committerJustin M. Keyes <justinkz@gmail.com>2017-03-17 12:20:51 +0100
commitf6946c68aee90c6ae8337b3e42c72943e37a507e (patch)
tree477386daf3393c1a71fec15eac3d75ec46d283d0 /src/nvim/memfile.c
parentad1884be0dcf029f7467e5cfad8ffe7c8ba461b6 (diff)
downloadrneovim-f6946c68aee90c6ae8337b3e42c72943e37a507e.tar.gz
rneovim-f6946c68aee90c6ae8337b3e42c72943e37a507e.tar.bz2
rneovim-f6946c68aee90c6ae8337b3e42c72943e37a507e.zip
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).
Diffstat (limited to 'src/nvim/memfile.c')
-rw-r--r--src/nvim/memfile.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c
index 43412e3916..5d6639c4d0 100644
--- a/src/nvim/memfile.c
+++ b/src/nvim/memfile.c
@@ -909,12 +909,7 @@ static bool mf_do_open(memfile_T *mfp, char_u *fname, int flags)
return false;
}
-#ifdef HAVE_FD_CLOEXEC
- int fdflags = fcntl(mfp->mf_fd, F_GETFD);
- if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) {
- (void)fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC);
- }
-#endif
+ (void)os_set_cloexec(mfp->mf_fd);
#ifdef HAVE_SELINUX
mch_copy_sec(fname, mfp->mf_fname);
#endif