summaryrefslogtreecommitdiff
path: root/src/memfile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-11-17 16:13:15 +0000
committerBram Moolenaar <Bram@vim.org>2009-11-17 16:13:15 +0000
commitf05da21900ee28e679a69439fd1c2ec94367e1d7 (patch)
tree94fa61ec2def86333b84eaa7bae85115f8373620 /src/memfile.c
parent2d7ff056e13e66c135c67935f32e15a26b8dfd80 (diff)
downloadvim-git-f05da21900ee28e679a69439fd1c2ec94367e1d7.tar.gz
updated for version 7.2-300v7.2.300
Diffstat (limited to 'src/memfile.c')
-rw-r--r--src/memfile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/memfile.c b/src/memfile.c
index 0b3cdd9be..bd03e65a6 100644
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -1343,6 +1343,11 @@ mf_do_open(mfp, fname, flags)
}
else
{
+#ifdef HAVE_FD_CLOEXEC
+ int fdflags = fcntl(mfp->mf_fd, F_GETFD);
+ if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
+ fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC);
+#endif
#ifdef HAVE_SELINUX
mch_copy_sec(fname, mfp->mf_fname);
#endif