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 / patches / old / 5.4.17 < prev    next >
Encoding:
Internet Message Format  |  1999-08-08  |  3.3 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 5.4.17
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.4.17
  8. Problem:    GUI: When started from inside gvim with ":!gvim", Vim would not
  9.             start.  ":!gvim -f" works fine.
  10. Solution:   After forking, wait a moment in the parent process, to give the
  11.             child a chance to set its process group.
  12. Files:      src/gui.c
  13.  
  14.  
  15. *** ../vim-5.4/src/gui.c    Sun Aug  8 21:29:08 1999
  16. --- src/gui.c    Sun Aug  8 21:18:09 1999
  17. ***************
  18. *** 101,106 ****
  19. --- 101,114 ----
  20.       if (pid == 0)    /* child */
  21.       {
  22.           (void)close(pfd[0]);    /* child closes its read end */
  23. +         /* Do the setsid() first, otherwise the exit() of the parent may
  24. +          * kill the child too (when starting gvim from inside a gvim). */
  25. + # if defined(HAVE_SETSID)
  26. +         (void)setsid();
  27. + # else
  28. +         (void)setpgid(0, 0);
  29. + # endif
  30.           termcapinit((char_u *)"builtin_gui");   /* goes to gui_init() */
  31.           gui.starting = recursive - 1;
  32.           (void)write(pfd[1], &gui.in_use, sizeof(int));
  33. ***************
  34. *** 108,118 ****
  35.           if (!gui.in_use)
  36.           exit(1);
  37.   
  38. - # if defined(HAVE_SETSID)
  39. -         (void)setsid();
  40. - # else
  41. -         (void)setpgid(0, 0);
  42. - # endif
  43.   #ifdef AUTOCMD
  44.           apply_autocmds(EVENT_GUIENTER, NULL, NULL, FALSE, curbuf);
  45.   #endif
  46. --- 116,121 ----
  47. ***************
  48. *** 167,173 ****
  49. --- 170,183 ----
  50.       {
  51.       pid = fork();
  52.       if (pid > 0)        /* Parent */
  53. +     {
  54. +         /* Give the child some time to do the setsid(), otherwise the
  55. +          * exit() may kill the child too (when starting gvim from inside a
  56. +          * gvim). */
  57. +         ui_delay(100, TRUE);
  58.           exit(0);
  59. +     }
  60.   # if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
  61.       /*
  62.        * Change our process group.  On some systems/shells a CTRL-C in the
  63. *** ../vim-5.4/src/version.h    Sun Aug  8 14:46:41 1999
  64. --- src/version.h    Sun Aug  8 21:30:06 1999
  65. ***************
  66. *** 19,26 ****
  67.   #define VIM_VERSION_MINOR_STR        "4"
  68.   #define VIM_VERSION_BUILD         57
  69.   #define VIM_VERSION_BUILD_STR        "57"
  70. ! #define VIM_VERSION_PATCHLEVEL         16
  71. ! #define VIM_VERSION_PATCHLEVEL_STR    "16"
  72.   
  73.   /*
  74.    * VIM_VERSION_NODOT is used for the runtime directory name.
  75. --- 19,26 ----
  76.   #define VIM_VERSION_MINOR_STR        "4"
  77.   #define VIM_VERSION_BUILD         57
  78.   #define VIM_VERSION_BUILD_STR        "57"
  79. ! #define VIM_VERSION_PATCHLEVEL         17
  80. ! #define VIM_VERSION_PATCHLEVEL_STR    "17"
  81.   
  82.   /*
  83.    * VIM_VERSION_NODOT is used for the runtime directory name.
  84. ***************
  85. *** 30,35 ****
  86.    */
  87.   #define VIM_VERSION_NODOT    "vim54"
  88.   #define VIM_VERSION_SHORT    "5.4"
  89. ! #define VIM_VERSION_MEDIUM    "5.4.16"
  90. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.16 (1999 Aug 8)"
  91. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.16 (1999 Aug 8, compiled "
  92. --- 30,35 ----
  93.    */
  94.   #define VIM_VERSION_NODOT    "vim54"
  95.   #define VIM_VERSION_SHORT    "5.4"
  96. ! #define VIM_VERSION_MEDIUM    "5.4.17"
  97. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.17 (1999 Aug 8)"
  98. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.17 (1999 Aug 8, compiled "
  99.  
  100. --
  101. BLACK KNIGHT: The Black Knight always triumphs. Have at you!
  102.    ARTHUR takes his last leg off.  The BLACK KNIGHT's body lands upright.
  103. BLACK KNIGHT: All right, we'll call it a draw.
  104.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  105.  
  106. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  107.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  108.