* fhandler_tty.cc (fhandler_tty_slave::init): Add additional checks to
determine when a process should grab control of a tty's pgid. Use being_debugged() for consistency. * debug.h (being_debugged): Remove vestige of win9x accommodation.
This commit is contained in:
		| @@ -1,3 +1,10 @@ | |||||||
|  | 2010-09-20  Christopher Faylor  <me+cygwin@cgf.cx> | ||||||
|  |  | ||||||
|  | 	* fhandler_tty.cc (fhandler_tty_slave::init): Add additional checks to | ||||||
|  | 	determine when a process should grab control of a tty's pgid.  Use | ||||||
|  | 	being_debugged() for consistency. | ||||||
|  | 	* debug.h (being_debugged): Remove vestige of win9x accommodation. | ||||||
|  |  | ||||||
| 2010-09-19  Christopher Faylor  <me+cygwin@cgf.cx> | 2010-09-19  Christopher Faylor  <me+cygwin@cgf.cx> | ||||||
|  |  | ||||||
| 	* wincap.h (wincaps::has_buggy_thread_startup): Declare. | 	* wincap.h (wincaps::has_buggy_thread_startup): Declare. | ||||||
|   | |||||||
| @@ -20,8 +20,7 @@ details. */ | |||||||
| #if !defined(_DEBUG_H_) | #if !defined(_DEBUG_H_) | ||||||
| #define _DEBUG_H_ | #define _DEBUG_H_ | ||||||
|  |  | ||||||
| #define being_debugged() \ | #define being_debugged() (IsDebuggerPresent ()) | ||||||
|   (IsDebuggerPresent () /* || GetLastError () == ERROR_PROC_NOT_FOUND*/) |  | ||||||
|  |  | ||||||
| #ifndef DEBUGGING | #ifndef DEBUGGING | ||||||
| # define cygbench(s) | # define cygbench(s) | ||||||
|   | |||||||
| @@ -710,7 +710,13 @@ fhandler_tty_slave::init (HANDLE f, DWORD a, mode_t) | |||||||
|     flags = O_RDWR; |     flags = O_RDWR; | ||||||
|  |  | ||||||
|   int ret = open (flags); |   int ret = open (flags); | ||||||
|   if (ret && !cygwin_finished_initializing && !IsDebuggerPresent ()) |  | ||||||
|  |   /* We should only grab this when the parent process owns the pgid | ||||||
|  |   (which could happen when a cygwin process starts a DOS process which | ||||||
|  |   starts a cygwin process or when we are being started directly from a | ||||||
|  |   windows process, e.g., from the CMD prompt.  */ | ||||||
|  |   if (ret && !cygwin_finished_initializing && !being_debugged () | ||||||
|  |       && (myself->ppid == 1 || myself->ppid == tc->getpgid ())) | ||||||
|     { |     { | ||||||
|       /* This only occurs when called from dtable::init_std_file_from_handle |       /* This only occurs when called from dtable::init_std_file_from_handle | ||||||
| 	 We have been started from a non-Cygwin process.  So we should become | 	 We have been started from a non-Cygwin process.  So we should become | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user