diff options
author | Christopher Faylor <me@cgf.cx> | 2000-10-09 06:53:44 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-10-09 06:53:44 +0400 |
commit | 164a681ca55419ec2cc7c9ad45f720f4a79cada1 (patch) | |
tree | 9344d3a28783e8c4bc55e1d616ca36746910bf3b /winsup/cygwin/dtable.cc | |
parent | 65bb926f51a5cac83b63e98e81121ece36d57454 (diff) |
* dtable.cc (set_std_handle): Use std_consts array to control SetStdHandle
settings.
(dtable::fixup_after_fork): Ditto.
* exceptions.cc (set_sig_errno): Remove some debugging output.
* path.cc (path_conv::check): Don't OR need_directory with flags sent to
symlink_info::check.
(symlink_info::check): Use PATH_ALL_EXEC to determine when a file is
executable.
* path.h (path_types): Add PATH_ALL_EXEC.
(isexec): Use PATH_ALL_EXEC so that cygexec types will be considered
executable.
* pinfo.h (_pinfo): Add a process handle that is kept open throughout the life
of a cygwin pid.
* sigproc.cc (proc_exists): Remove hopefully obsolete stuff.
(proc_subproc): Set up process handle that is kept open throughout the life of
a cygwin pid. Reorganize PROC_WAIT stuff to use common code.
(proc_terminate): Close pid lifetime process handle.
(checkstate): Cleanup.
(stopped_or_terminated): Move zombie cleanup.
(remove_zombie): To here.
* spawn.cc (spawn_guts): Reorganize reparenting code for 1247th time.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r-- | winsup/cygwin/dtable.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 5eff4fd66..f149d562b 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -33,6 +33,9 @@ details. */ dtable fdtab; +static DWORD std_consts[] = {STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, + STD_ERROR_HANDLE}; + /* Set aside space for the table of fds */ void dtable_init (void) @@ -45,11 +48,9 @@ void __stdcall set_std_handle (int fd) { if (fd == 0) - SetStdHandle (STD_INPUT_HANDLE, fdtab[fd]->get_handle ()); - else if (fd == 1) - SetStdHandle (STD_OUTPUT_HANDLE, fdtab[fd]->get_output_handle ()); - else if (fd == 2) - SetStdHandle (STD_ERROR_HANDLE, fdtab[fd]->get_output_handle ()); + SetStdHandle (std_consts[fd], fdtab[fd]->get_handle ()); + else if (fd <= 2) + SetStdHandle (std_consts[fd], fdtab[fd]->get_output_handle ()); } int @@ -453,7 +454,13 @@ dtable::fixup_after_exec (HANDLE parent, size_t sz, fhandler_base **f) if (fds[i]->get_close_on_exec ()) release (i); else - fds[i]->fixup_after_exec (parent); + { + fds[i]->fixup_after_exec (parent); + if (i == 0) + SetStdHandle (std_consts[i], fds[i]->get_io_handle ()); + else if (i <= 2) + SetStdHandle (std_consts[i], fds[i]->get_output_handle ()); + } } } |