From: cgf Date: Wed, 31 Oct 2001 02:03:00 +0000 (+0000) Subject: * fhandler.cc (fhandler_base::fork_fixup): Pass old handle to setclexec_pid. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d937b2af5accfd34fa2dcf6173cf84c961b504e2;p=pf3gnuchains%2Fsourceware.git * fhandler.cc (fhandler_base::fork_fixup): Pass old handle to setclexec_pid. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 98ac1d3646..69f649554b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2001-10-30 Christopher Faylor + * fhandler.cc (fhandler_base::fork_fixup): Pass old handle to + setclexec_pid. + +2001-10-30 Christopher Faylor + * cygheap.h (cygheap_fdmanip::cygheap_fdmanip): Clear fh. (cygheap_fdmanip::isopen): New method. * syscalls.cc (_read): Avoid accessing closed fd. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 682f4b7154..9617790e24 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1644,7 +1644,7 @@ fhandler_base::fork_fixup (HANDLE parent, HANDLE &h, const char *name) { debug_printf ("%s success - oldh %p, h %p", get_name (), oh, h); // someday, maybe ProtectHandle2 (h, name); - setclexec_pid (h, h, !get_close_on_exec ()); + setclexec_pid (oh, h, !get_close_on_exec ()); } #endif }