Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-08-17 20:10:48 +0400
committerChristopher Faylor <me@cgf.cx>2005-08-17 20:10:48 +0400
commit0d339267ec52b1be15ea21508c79c64c2c524625 (patch)
tree7d5a4f0bc5897184fe0bec3218186abb9bb3a17b /winsup
parentac6001df45ce49adc7c58b6080b9223b42b458b3 (diff)
* dcrt0.cc (dll_crt0_1): Tweak debugging stuff.
* fhandler_tty.cc (fhandler_tty_common::close): Rearrange the code so that the master end of the input and output pipes is closed before signalling an EOF event to the slave. (fhandler_pty_master::close): Likewise.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog11
-rw-r--r--winsup/cygwin/dcrt0.cc5
-rw-r--r--winsup/cygwin/fhandler_tty.cc16
3 files changed, 24 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 18c50258d..77ca68274 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,14 @@
+2005-08-17 Christopher Faylor <cgf@timesys.com>
+
+ * dcrt0.cc (dll_crt0_1): Tweak debugging stuff.
+
+2005-08-17 Pavel Tsekov <ptsekov@gmx.net>
+
+ * fhandler_tty.cc (fhandler_tty_common::close): Rearrange the code so
+ that the master end of the input and output pipes is closed before
+ signalling an EOF event to the slave.
+ (fhandler_pty_master::close): Likewise.
+
2005-08-14 Corinna Vinschen <corinna@vinschen.de>
* init.cc (respawn_wow64_process): Make inline function. Remove
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 302e03459..e88f64a16 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -725,8 +725,9 @@ dll_crt0_1 (char *)
malloc_init ();
#ifdef CGF
int i = 0;
- while (i)
- cmalloc (HEAP_STR, 2000000);
+ const int n = 2 * 1024 * 1024;
+ while (i--)
+ small_printf ("cmalloc returns %p\n", cmalloc (HEAP_STR, n));
#endif
/* Initialize SIGSEGV handling, etc. */
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index a644c0f78..a7d0afb8b 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1196,6 +1196,10 @@ fhandler_tty_common::close ()
termios_printf ("CloseHandle (input_mutex<%p>), %E", input_mutex);
if (!ForceCloseHandle (output_mutex))
termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex);
+ if (!ForceCloseHandle1 (get_handle (), from_pty))
+ termios_printf ("CloseHandle (get_handle ()<%p>), %E", get_handle ());
+ if (!ForceCloseHandle1 (get_output_handle (), to_pty))
+ termios_printf ("CloseHandle (get_output_handle ()<%p>), %E", get_output_handle ());
/* Send EOF to slaves if master side is closed */
if (!get_ttyp ()->master_alive ())
@@ -1206,10 +1210,6 @@ fhandler_tty_common::close ()
if (!ForceCloseHandle (input_available_event))
termios_printf ("CloseHandle (input_available_event<%p>), %E", input_available_event);
- if (!ForceCloseHandle1 (get_handle (), from_pty))
- termios_printf ("CloseHandle (get_handle ()<%p>), %E", get_handle ());
- if (!ForceCloseHandle1 (get_output_handle (), to_pty))
- termios_printf ("CloseHandle (get_output_handle ()<%p>), %E", get_output_handle ());
if (!hExeced)
{
@@ -1226,9 +1226,10 @@ fhandler_pty_master::close ()
while (accept_input () > 0)
continue;
#endif
- fhandler_tty_common::close ();
- if (!get_ttyp ()->master_alive ())
+ if (get_ttyp ()->master_alive ())
+ fhandler_tty_common::close ();
+ else
{
termios_printf ("freeing tty%d (%d)", get_unit (), get_ttyp ()->ntty);
#if 0
@@ -1241,6 +1242,9 @@ fhandler_pty_master::close ()
CloseHandle (get_ttyp ()->from_master);
if (get_ttyp ()->to_master)
CloseHandle (get_ttyp ()->to_master);
+
+ fhandler_tty_common::close ();
+
if (!hExeced)
get_ttyp ()->init ();
}