4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
10 Patch 7.1.288 (after 7.1.281)
11 Problem: Cscope still leaves behind temp files when using gvim.
12 Solution: When getting the ECHILD error loop for a while until cscope exits.
17 *** ../vim-7.1.287/src/if_cscope.c Sun Mar 16 16:02:47 2008
18 --- src/if_cscope.c Tue Mar 25 21:34:23 2008
33 /* Block until cscope exits or until timer expires */
34 pid = waitpid(csinfo[i].pid, &pstat, 0);
35 + waitpid_errno = errno;
37 /* cancel pending alarm if still there and restore signal */
42 for (waited = 0; waited < 40; ++waited)
44 pid = waitpid(csinfo[i].pid, &pstat, WNOHANG);
45 + waitpid_errno = errno;
47 break; /* break unless the process is still running */
48 mch_delay(50, FALSE); /* sleep 50 ms */
52 if (pid < 0 && csinfo[i].pid > 1)
54 ! kill(csinfo[i].pid, SIGKILL);
55 ! (void)waitpid(csinfo[i].pid, &pstat, 0);
61 if (pid < 0 && csinfo[i].pid > 1)
66 ! if (waitpid_errno == ECHILD)
69 ! * When using 'vim -g', vim is forked and cscope process is
70 ! * no longer a child process but a sibling. So waitpid()
71 ! * fails with errno being ECHILD (No child processes).
72 ! * Don't send SIGKILL to cscope immediately but wait
73 ! * (polling) for it to exit normally as result of sending
74 ! * the "q" command, hence giving it a chance to clean up
75 ! * its temporary files.
80 ! for (waited = 0; waited < 40; ++waited)
82 ! /* Check whether cscope process is still alive */
83 ! if (kill(csinfo[i].pid, 0) != 0)
85 ! alive = FALSE; /* cscope process no longer exists */
88 ! mch_delay(50, FALSE); /* sleep 50ms */
94 ! kill(csinfo[i].pid, SIGKILL);
95 ! (void)waitpid(csinfo[i].pid, &pstat, 0);
100 *** ../vim-7.1.287/src/version.c Tue Apr 1 13:10:45 2008
101 --- src/version.c Tue Apr 1 14:28:42 2008
105 { /* Add new patch number below this line */
111 hundred-and-one symptoms of being an internet addict:
112 204. You're being audited because you mailed your tax return to the IRC.
114 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
115 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
116 \\\ download, build and distribute -- http://www.A-A-P.org ///
117 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///