home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unreleased / patches / 5.6a.026 < prev    next >
Encoding:
Internet Message Format  |  2000-01-13  |  2.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6a.026
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6a.026
  8. Problem:    When the SNiFF connection is open, shell commands hang. (Pruemmer)
  9. Solution:   Skip a second wait() call if waitpid() already detected that the
  10.         child has exited.
  11. Files:        src/os_unix.c
  12.  
  13.  
  14. *** ../vim-5.6a.25/src/os_unix.c    Mon Dec 20 09:59:13 1999
  15. --- src/os_unix.c    Fri Jan 14 22:27:22 2000
  16. ***************
  17. *** 2171,2177 ****
  18.   
  19.       char_u    *newcmd = NULL;
  20.       pid_t    pid;
  21. !     pid_t    wait_pid;
  22.   #ifdef HAVE_UNION_WAIT
  23.       union wait    status;
  24.   #else
  25. --- 2171,2177 ----
  26.   
  27.       char_u    *newcmd = NULL;
  28.       pid_t    pid;
  29. !     pid_t    wait_pid = 0;
  30.   #ifdef HAVE_UNION_WAIT
  31.       union wait    status;
  32.   #else
  33. ***************
  34. *** 2631,2637 ****
  35. --- 2631,2641 ----
  36.   #endif
  37.               if ((wait_pid == (pid_t)-1 && errno == ECHILD)
  38.                   || (wait_pid == pid && WIFEXITED(status)))
  39. +             {
  40. +             wait_pid = pid;
  41.               break;
  42. +             }
  43. +             wait_pid = 0;
  44.           }
  45.   finished:
  46.           p_more = p_more_save;
  47. ***************
  48. *** 2653,2664 ****
  49.            * Wait until our child has exited.
  50.            * Ignore wait() returning pids of other children and returning
  51.            * because of some signal like SIGWINCH.
  52.            */
  53. !         for (;;)
  54.           {
  55.           wait_pid = wait(&status);
  56. -         if (wait_pid == pid)
  57. -             break;
  58.           if (wait_pid <= 0
  59.   #ifdef ECHILD
  60.               && errno == ECHILD
  61. --- 2657,2668 ----
  62.            * Wait until our child has exited.
  63.            * Ignore wait() returning pids of other children and returning
  64.            * because of some signal like SIGWINCH.
  65. +          * Don't wait if wait_pid was already set above, indicating the
  66. +          * child already exited.
  67.            */
  68. !         while (wait_pid != pid)
  69.           {
  70.           wait_pid = wait(&status);
  71.           if (wait_pid <= 0
  72.   #ifdef ECHILD
  73.               && errno == ECHILD
  74. *** ../vim-5.6a.25/src/version.c    Thu Jan 13 23:05:21 2000
  75. --- src/version.c    Fri Jan 14 22:24:09 2000
  76. ***************
  77. *** 420,421 ****
  78. --- 420,423 ----
  79.   {   /* Add new patch number below this line */
  80. + /**/
  81. +     26,
  82.   /**/
  83.  
  84. -- 
  85. hundred-and-one symptoms of being an internet addict:
  86. 173. You keep tracking down the email addresses of all your friends
  87.      (even childhood friends).
  88.  
  89. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  90.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  91.