Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-03-17 02:38:22 +0300
committerChristopher Faylor <me@cgf.cx>2003-03-17 02:38:22 +0300
commit3edb5f76bc780b384a651f4d2c2a661e7e641086 (patch)
tree845dba4691aa8228d0160b266e337b4c7e1881e7
parent5a436b4d53ebe28fdfccd0b3a7be26a650e7d617 (diff)
* fhandler_console.cc (fhandler_console::close): Correct check for current tty.unlabeled-1.120.2
Add debugging output when console is freed. (set_console_state_for_spawn): Add debugging output. * fhandler_tty.cc (fhandler_tty_slave::open): Don't decrement console open flag when vforking. * sigproc.cc (sigproc_terminate): Fix debugging output. * spawn.cc (handle): Eliminate second argument. (spawn_guts): Reflect elimination of argument change to handle. * syscalls.cc (setsid): Add debugging output when console is freed.
-rw-r--r--winsup/cygwin/spawn.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index f6863e88d..f7bcbcc89 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -180,7 +180,7 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv,
/* Utility for spawn_guts. */
static HANDLE
-handle (int n, int direction)
+handle (int n)
{
fhandler_base *fh = cygheap->fdtab[n];
@@ -188,9 +188,7 @@ handle (int n, int direction)
return INVALID_HANDLE_VALUE;
if (fh->get_close_on_exec ())
return INVALID_HANDLE_VALUE;
- if (direction == 0)
- return fh->get_handle ();
- return fh->get_output_handle ();
+ return n ? fh->get_output_handle () : fh->get_handle ();
}
int
@@ -591,15 +589,18 @@ spawn_guts (const char * prog_arg, const char *const *argv,
si.lpReserved = NULL;
si.lpDesktop = NULL;
si.dwFlags = STARTF_USESTDHANDLES;
- si.hStdInput = handle (0, 0); /* Get input handle */
- si.hStdOutput = handle (1, 1); /* Get output handle */
- si.hStdError = handle (2, 1); /* Get output handle */
+ si.hStdInput = handle (0); /* Get input handle */
+ si.hStdOutput = handle (1); /* Get output handle */
+ si.hStdError = handle (2); /* Get output handle */
si.cb = sizeof (si);
int flags = CREATE_DEFAULT_ERROR_MODE | GetPriorityClass (hMainProc);
if (mode == _P_DETACH || !set_console_state_for_spawn ())
- flags |= DETACHED_PROCESS;
+ {
+ debug_printf ("mode %c= _P_DETACH", mode == _P_DETACH ? '=' : '!');
+ flags |= DETACHED_PROCESS;
+ }
if (mode != _P_OVERLAY)
flags |= CREATE_SUSPENDED;