To: vim-dev@vim.org Subject: Patch 5.6.025 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.6.025 Problem: GTK GUI: Starting the GUI could be interrupted by a SIGWINCH. (Nils Lohner) Solution: Repeat the read() call to get the gui_in_use value when interrupted by a signal. Files: src/gui.c *** ../vim-5.6.24/src/gui.c Mon Jan 24 13:09:40 2000 --- src/gui.c Thu Mar 23 10:06:29 2000 *************** *** 125,141 **** else /* parent */ { int gui_in_use; (void)close(pfd[1]); /* parent closes its write end */ ! if (read(pfd[0], &gui_in_use, sizeof(int)) <= 0 || !gui_in_use) { ! EMSG("child process failed to start gui"); ! (void)close(pfd[0]); ! /* terminate the child process, in case it's still around */ ! (void)kill(pid, SIGTERM); } ! else exit(0); /* child was successful, parent can exit */ } } else --- 125,155 ---- else /* parent */ { int gui_in_use; + int i; (void)close(pfd[1]); /* parent closes its write end */ ! ! /* ! * Repeat the read() when interrupted by a signal. Could be a ! * harmless SIGWINCH. ! */ ! for (;;) { ! i = read(pfd[0], &gui_in_use, sizeof(int)); ! if (i != sizeof(int)) ! gui_in_use = 0; ! #ifdef EINTR ! if (i >= 0 || errno != EINTR) ! #endif ! break; } ! if (gui_in_use) exit(0); /* child was successful, parent can exit */ + + EMSG("child process failed to start gui"); + (void)close(pfd[0]); + /* terminate the child process, in case it's still around */ + (void)kill(pid, SIGTERM); } } else *** ../vim-5.6.24/src/version.c Sat Mar 25 18:18:07 2000 --- src/version.c Sat Mar 25 18:32:27 2000 *************** *** 420,421 **** --- 420,423 ---- { /* Add new patch number below this line */ + /**/ + 25, /**/ -- Ten million Linux users can't be wrong! /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\ \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/