diff src/process-nt.c @ 363:972bbb6d6ca2 r21-1-11

Import from CVS: tag r21-1-11
author cvs
date Mon, 13 Aug 2007 10:59:28 +0200
parents 8e84bee8ddd0
children cc15677e0335
line wrap: on
line diff
--- a/src/process-nt.c	Mon Aug 13 10:58:41 2007 +0200
+++ b/src/process-nt.c	Mon Aug 13 10:59:28 2007 +0200
@@ -49,7 +49,6 @@
 struct nt_process_data
 {
   HANDLE h_process;
-  int need_enable_child_signals;
 };
 
 #define NT_DATA(p) ((struct nt_process_data*)((p)->process_data))
@@ -469,7 +468,7 @@
 
       /* Duplicate the stdout handle for use as stderr */
       DuplicateHandle(GetCurrentProcess(), hprocout, GetCurrentProcess(), &hprocerr,
-       0, TRUE, DUPLICATE_SAME_ACCESS);
+					  0, TRUE, DUPLICATE_SAME_ACCESS);
 
       /* Stupid Win32 allows to create a pipe with *both* ends either
 	 inheritable or not. We need process ends inheritable, and local
@@ -598,7 +597,7 @@
       {
 	si.hStdInput = hprocin;
 	si.hStdOutput = hprocout;
-       si.hStdError = hprocerr;
+	si.hStdError = hprocerr;
 	si.dwFlags |= STARTF_USESTDHANDLES;
       }
 
@@ -613,7 +612,7 @@
 	/* These just have been inherited; we do not need a copy */
 	CloseHandle (hprocin);
 	CloseHandle (hprocout);
-       CloseHandle (hprocerr);
+	CloseHandle (hprocerr);
       }
     
     /* Handle process creation failure */
@@ -640,18 +639,12 @@
 	CloseHandle (pi.hProcess);
       }
 
+    if (!windowed)
+      enable_child_signals (pi.hProcess);
+
     ResumeThread (pi.hThread);
     CloseHandle (pi.hThread);
 
-    /* Remember to enable child signals later if this is not a windowed
-       app.  Can't do it right now because that screws up the MKS Toolkit
-       shell. */
-    if (!windowed)
-      {
-       NT_DATA(p)->need_enable_child_signals = 10;
-       kick_status_notify ();
-      }
-
     /* Hack to support Windows 95 negative pids */
     return ((int)pi.dwProcessId < 0
 	    ? -(int)pi.dwProcessId : (int)pi.dwProcessId);
@@ -670,18 +663,6 @@
 nt_update_status_if_terminated (struct Lisp_Process* p)
 {
   DWORD exit_code;
-
-  if (NT_DATA(p)->need_enable_child_signals > 1)
-    {
-      NT_DATA(p)->need_enable_child_signals -= 1;
-      kick_status_notify ();
-    }
-  else if (NT_DATA(p)->need_enable_child_signals == 1)
-    {
-      enable_child_signals(NT_DATA(p)->h_process);
-      NT_DATA(p)->need_enable_child_signals = 0;
-    }
-
   if (GetExitCodeProcess (NT_DATA(p)->h_process, &exit_code)
       && exit_code != STILL_ACTIVE)
     {
@@ -783,14 +764,6 @@
 {
   struct Lisp_Process *p = XPROCESS (proc);
 
-  /* Enable child signals if necessary.  This may lose the first
-     but it's better than nothing. */
-  if (NT_DATA(p)->need_enable_child_signals > 0)
-    {
-      enable_child_signals(NT_DATA(p)->h_process);
-      NT_DATA(p)->need_enable_child_signals = 0;
-    }
-
   /* Signal error if SIGNO cannot be sent */
   validate_signal_number (signo);