This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin/cygwin-2.0] Fix closing too many handles in pty fchown/fchmod


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4e99630cfdfa582feb6deeb12f6fbee92d15d44e

commit 4e99630cfdfa582feb6deeb12f6fbee92d15d44e
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Apr 22 13:26:37 2015 +0200

    Fix closing too many handles in pty fchown/fchmod
    
    	* fhandler_tty.cc (fhandler_pty_slave::fch_close_handles): Don't close
    	handles not opened via fhandler_pty_slave::fch_open_handles.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/ChangeLog       | 5 +++++
 winsup/cygwin/fhandler_tty.cc | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7e9de3f..0c9478e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-22  Corinna Vinschen  <corinna@vinschen.de>
+
+	* fhandler_tty.cc (fhandler_pty_slave::fch_close_handles): Don't close
+	handles not opened via fhandler_pty_slave::fch_open_handles.
+
 2015-04-22  Takashi Yano  <takashi.yano@nifty.ne.jp>
 
 	* fhandler.h (class fhandler_base): Add virtual function
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index d3fbcee..f9205f6 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1084,9 +1084,6 @@ fhandler_pty_slave::fch_set_sd (security_descriptor &sd, bool chown)
 void
 fhandler_pty_slave::fch_close_handles ()
 {
-  close_maybe (get_io_handle ());
-  close_maybe (get_output_handle ());
-  close_maybe (get_output_handle_cyg ());
   close_maybe (input_available_event);
   close_maybe (output_mutex);
   close_maybe (input_mutex);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]