diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3dd149067..1658c0870 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2010-08-14 Corinna Vinschen + + * pipe.cc (fhandler_pipe::open): Duplicate content of opened pipe + fhandler before calling dup method. + 2010-08-13 Corinna Vinschen * cygheap.h (class cwdstuff): Make drive_length private. diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 29bd73205..2f3bebe2c 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -86,6 +86,9 @@ fhandler_pipe::open (int flags, mode_t mode) set_errno (EACCES); return 0; } + *this = *(fhandler_pipe *) cfd; + set_io_handle (NULL); + pc.reset_conv_handle (); if (!cfd->dup (this)) return 1; return 0;