]> granicus.if.org Git - vim/commitdiff
updated for version 7.2-300 v7.2.300
authorBram Moolenaar <Bram@vim.org>
Tue, 17 Nov 2009 16:13:15 +0000 (16:13 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 17 Nov 2009 16:13:15 +0000 (16:13 +0000)
src/auto/configure
src/config.h.in
src/configure.in
src/fileio.c
src/memfile.c
src/memline.c
src/version.c

index eb683c14a5d31655b2d837a70b0687ef7ed6447d..7230ce3956d1647c69014ac736e5b45514870bf5 100755 (executable)
@@ -15174,6 +15174,58 @@ else
 $as_echo "yes" >&6; }
 fi
 
+{ $as_echo "$as_me:$LINENO: checking for FD_CLOEXEC" >&5
+$as_echo_n "checking for FD_CLOEXEC... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+int
+main ()
+{
+       int flag = FD_CLOEXEC;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }; cat >>confdefs.h <<\_ACEOF
+#define HAVE_FD_CLOEXEC 1
+_ACEOF
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       { $as_echo "$as_me:$LINENO: result: not usable" >&5
+$as_echo "not usable" >&6; }
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 { $as_echo "$as_me:$LINENO: checking for rename" >&5
 $as_echo_n "checking for rename... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
index 0d39b438804f6a7ccf52e0597d2f47e3aa90f81c..2b2730eb4d61c7494e9bdecf05f8881c8f0d5e33 100644 (file)
 
 /* Define if you want XSMP interaction as well as vanilla swapfile safety */
 #undef USE_XSMP_INTERACT
+
+/* Define if fcntl()'s F_SETFD command knows about FD_CLOEXEC */
+#undef HAVE_FD_CLOEXEC
index f994677b82f426d60a5e2f17e076b864a442a2d9..727bfd1bb51a3a51f1b9219979ce1d1158065b6f 100644 (file)
@@ -2855,6 +2855,16 @@ else
   AC_MSG_RESULT(yes)
 fi
 
+dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known
+AC_MSG_CHECKING(for FD_CLOEXEC)
+AC_TRY_COMPILE(
+[#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif],
+[      int flag = FD_CLOEXEC;],
+       AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC),
+       AC_MSG_RESULT(not usable))
+
 dnl rename needs to be checked separately to work on Nextstep with cc
 AC_MSG_CHECKING(for rename)
 AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
index fa07afe1f96ced075749cda7b56554225a6ddbfa..b0b341a2e2af9d53255565968306845d23db6ee4 100644 (file)
@@ -2254,6 +2254,14 @@ failed:
 
     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
index 0b3cdd9be1b276ccadd22aa6c73cd774922a375d..bd03e65a6de985bf9bc8ec08a5770bff03aa20d4 100644 (file)
@@ -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
index facdeb62e3d6bbe99182d29a2bb2d2e43656bd1e..480e93cf640a9dc53236bf9b9dda5ba50dae87a3 100644 (file)
@@ -382,7 +382,7 @@ ml_open(buf)
     dp->db_index[0] = --dp->db_txt_start;      /* at end of block */
     dp->db_free -= 1 + INDEX_SIZE;
     dp->db_line_count = 1;
-    *((char_u *)dp + dp->db_txt_start) = NUL;  /* emtpy line */
+    *((char_u *)dp + dp->db_txt_start) = NUL;  /* empty line */
 
     return OK;
 
@@ -490,6 +490,13 @@ ml_setname(buf)
            EMSG(_("E301: Oops, lost the swap file!!!"));
            return;
        }
+#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
     }
     if (!success)
        EMSG(_("E302: Could not rename swap file"));
index 1460a8db2b5bb3c99b5d12ec418220e57162c254..a889332ba345f7634f48650246852a9e3244bbe5 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    300,
 /**/
     299,
 /**/