* fhandler.cc (fhandler_base::dup): Avoid duping a handle when an fhandler has

an archetype.
* fhandler_console.cc (fhandler_console::invisible_console): Move to the top.
(fhandler_console::set_close_on_exec): Don't set close-on-exec on handle since
it's an archetype and you don't know how many things could be using it.
This commit is contained in:
Christopher Faylor 2011-05-06 20:12:20 +00:00
parent b66dba56c5
commit f4c566233f
3 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,13 @@
2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx>
* fhandler.cc (fhandler_base::dup): Avoid duping a handle when an
fhandler has an archetype.
* fhandler_console.cc (fhandler_console::invisible_console): Move to
the top.
(fhandler_console::set_close_on_exec): Don't set close-on-exec on
handle since it's an archetype and you don't know how many things could
be using it.
2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx> 2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx>
* fhandler.h (fhandler_dev_dsp): Cosmetic change. * fhandler.h (fhandler_dev_dsp): Cosmetic change.

View File

@ -1246,7 +1246,7 @@ fhandler_base::dup (fhandler_base *child)
debug_printf ("in fhandler_base dup"); debug_printf ("in fhandler_base dup");
HANDLE nh; HANDLE nh;
if (!nohandle ()) if (!nohandle () && !archetype)
{ {
if (!DuplicateHandle (GetCurrentProcess (), get_handle (), if (!DuplicateHandle (GetCurrentProcess (), get_handle (),
GetCurrentProcess (), &nh, GetCurrentProcess (), &nh,

View File

@ -56,6 +56,8 @@ const unsigned fhandler_console::MAX_WRITE_CHARS = 16384;
static console_state NO_COPY *shared_console_info; static console_state NO_COPY *shared_console_info;
bool NO_COPY fhandler_console::invisible_console;
dev_console NO_COPY *fhandler_console::dev_state; dev_console NO_COPY *fhandler_console::dev_state;
static void static void
@ -2103,8 +2105,7 @@ fhandler_console::igncr_enabled ()
void void
fhandler_console::set_close_on_exec (bool val) fhandler_console::set_close_on_exec (bool val)
{ {
fhandler_base::set_close_on_exec (val); close_on_exec (val);
set_no_inheritance (output_handle, val);
} }
void __stdcall void __stdcall
@ -2123,8 +2124,6 @@ fhandler_console::fixup_after_fork_exec (bool execing)
get_tty_stuff (); get_tty_stuff ();
} }
bool NO_COPY fhandler_console::invisible_console;
// #define WINSTA_ACCESS (WINSTA_READATTRIBUTES | STANDARD_RIGHTS_READ | STANDARD_RIGHTS_WRITE | WINSTA_CREATEDESKTOP | WINSTA_EXITWINDOWS) // #define WINSTA_ACCESS (WINSTA_READATTRIBUTES | STANDARD_RIGHTS_READ | STANDARD_RIGHTS_WRITE | WINSTA_CREATEDESKTOP | WINSTA_EXITWINDOWS)
#define WINSTA_ACCESS WINSTA_ALL_ACCESS #define WINSTA_ACCESS WINSTA_ALL_ACCESS