]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.268 v7.3.268
authorBram Moolenaar <Bram@vim.org>
Thu, 4 Aug 2011 17:36:52 +0000 (19:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 4 Aug 2011 17:36:52 +0000 (19:36 +0200)
Problem:    Vim freezes when executing an external command with zsh.
Solution:   Use O_NOCTTY both in the master and slave. (Bjorn Winckler)

src/os_unix.c
src/version.c

index a3c4fd690f530521d3d870f460e89e6f02cb6e50..391af9cb13ffd9077655b4aa97cfdb4b1a55c2e4 100644 (file)
@@ -3889,11 +3889,21 @@ mch_call_shell(cmd, options)
        if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
        {
            pty_master_fd = OpenPTY(&tty_name);     /* open pty */
-           if (pty_master_fd >= 0 && ((pty_slave_fd =
-                                   open(tty_name, O_RDWR | O_EXTRA, 0)) < 0))
+           if (pty_master_fd >= 0)
            {
-               close(pty_master_fd);
-               pty_master_fd = -1;
+               /* Leaving out O_NOCTTY may lead to waitpid() always returning
+                * 0 on Mac OS X 10.7 thereby causing freezes. Let's assume
+                * adding O_NOCTTY always works when defined. */
+#ifdef O_NOCTTY
+               pty_slave_fd = open(tty_name, O_RDWR | O_NOCTTY | O_EXTRA, 0);
+#else
+               pty_slave_fd = open(tty_name, O_RDWR | O_EXTRA, 0);
+#endif
+               if (pty_slave_fd < 0)
+               {
+                   close(pty_master_fd);
+                   pty_master_fd = -1;
+               }
            }
        }
        /*
index 6bddff0cc0243a8127411cbdb3a442f5b5d723de..8adefc0809fcfcbd97ec7f183f697cd94281b08c 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    268,
 /**/
     267,
 /**/