updated for version 7.2-300
diff --git a/src/fileio.c b/src/fileio.c
index fa07afe..b0b341a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2254,6 +2254,14 @@
 
     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)
+	    fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC);
+    }
+#endif
     vim_free(buffer);
 
 #ifdef HAVE_DUP