I have applied this to the 21.1 branch for XEmacs.
It will appear in 21.1.11 Real Soon Now.
- vin
>>>> On 07 May 2000, Adrian Aichner
<aichner(a)ecf.teradyne.com> said:
>>>> "Ben" == Ben Wing <ben(a)666.com>
writes:
Ben> adrian, i think the stderr changes are unrelated. you
Ben> probably shouldn't back them out, just the
Ben> enable_child_signals changes.
APA> OK, here's a revised patch tested against 21.1.10 vanilla.
APA> It retains STDERR handling improvements.
APA> Best regards,
APA> Adrian
APA> cd d:\tmp\21.1\xemacs\
APA> cvs diff src
APA> Compilation started at Sun May 07 17:23:56 2000 +0200 (W. Europe Daylight Time)
APA> ? src/call-process.err
APA> ? src/cvs-update.err
APA> ? src/SATISFIED
APA> ? src/stat-fstat
APA> ? src/stat-fstat-h
APA> ? src/temacs.bsc
APA> ? src/temacs.map
APA> ? src/xemacs.opt
APA> cvs server: Diffing src
APA> Index: src/process-nt.c
APA> ===================================================================
APA> RCS file: /usr/CVSroot/XEmacs/xemacs/src/process-nt.c,v
APA> retrieving revision 1.15
APA> diff -u -r1.15 process-nt.c
APA> --- process-nt.c 1999/12/04 04:13:05 1.15
APA> +++ process-nt.c 2000/05/07 15:31:54
APA> @@ -49,7 +49,6 @@
APA> struct nt_process_data
APA> {
APA> HANDLE h_process;
APA> - int need_enable_child_signals;
APA> };
APA> #define NT_DATA(p) ((struct nt_process_data*)((p)->process_data))
APA> @@ -469,7 +468,7 @@
APA> /* Duplicate the stdout handle for use as stderr */
APA> DuplicateHandle(GetCurrentProcess(), hprocout, GetCurrentProcess(),
&hprocerr,
APA> - 0, TRUE, DUPLICATE_SAME_ACCESS);
APA> + 0, TRUE, DUPLICATE_SAME_ACCESS);
APA> /* Stupid Win32 allows to create a pipe with *both* ends either
APA> inheritable or not. We need process ends inheritable, and local
APA> @@ -598,7 +597,7 @@
APA> {
APA> si.hStdInput = hprocin;
APA> si.hStdOutput = hprocout;
APA> - si.hStdError = hprocerr;
APA> + si.hStdError = hprocerr;
APA> si.dwFlags |= STARTF_USESTDHANDLES;
APA> }
APA> @@ -613,7 +612,7 @@
APA> /* These just have been inherited; we do not need a copy */
APA> CloseHandle (hprocin);
APA> CloseHandle (hprocout);
APA> - CloseHandle (hprocerr);
APA> + CloseHandle (hprocerr);
APA> }
APA> /* Handle process creation failure */
APA> @@ -640,18 +639,12 @@
APA> CloseHandle (pi.hProcess);
APA> }
APA> + if (!windowed)
APA> + enable_child_signals (pi.hProcess);
APA> +
APA> ResumeThread (pi.hThread);
APA> CloseHandle (pi.hThread);
APA> - /* Remember to enable child signals later if this is not a windowed
APA> - app. Can't do it right now because that screws up the MKS Toolkit
APA> - shell. */
APA> - if (!windowed)
APA> - {
APA> - NT_DATA(p)->need_enable_child_signals = 10;
APA> - kick_status_notify ();
APA> - }
APA> -
APA> /* Hack to support Windows 95 negative pids */
APA> return ((int)pi.dwProcessId < 0
APA> ? -(int)pi.dwProcessId : (int)pi.dwProcessId);
APA> @@ -670,18 +663,6 @@
APA> nt_update_status_if_terminated (struct Lisp_Process* p)
APA> {
APA> DWORD exit_code;
APA> -
APA> - if (NT_DATA(p)->need_enable_child_signals > 1)
APA> - {
APA> - NT_DATA(p)->need_enable_child_signals -= 1;
APA> - kick_status_notify ();
APA> - }
APA> - else if (NT_DATA(p)->need_enable_child_signals == 1)
APA> - {
APA> - enable_child_signals(NT_DATA(p)->h_process);
APA> - NT_DATA(p)->need_enable_child_signals = 0;
APA> - }
APA> -
APA> if (GetExitCodeProcess (NT_DATA(p)->h_process, &exit_code)
APA> && exit_code != STILL_ACTIVE)
APA> {
APA> @@ -782,14 +763,6 @@
APA> int current_group, int nomsg)
APA> {
APA> struct Lisp_Process *p = XPROCESS (proc);
APA> -
APA> - /* Enable child signals if necessary. This may lose the first
APA> - but it's better than nothing. */
APA> - if (NT_DATA(p)->need_enable_child_signals > 0)
APA> - {
APA> - enable_child_signals(NT_DATA(p)->h_process);
APA> - NT_DATA(p)->need_enable_child_signals = 0;
APA> - }
APA> /* Signal error if SIGNO cannot be sent */
APA> validate_signal_number (signo);
APA> Compilation exited abnormally with code 1 at Sun May 07 17:24:10
APA> --
APA> Adrian Aichner <adrian(a)xemacs.org>