Mail Archives: cygwin-developers/1998/02/15/08:34:33
tty.cc (fhandler_tty_slave::open): call DuplicateHandle() instead of copying.
f:\cygnus\cdk\winsup>diff -up tty.cc.orig tty.cc
--- tty.cc.orig Wed Feb 11 06:15:20 1998
+++ tty.cc Sun Feb 15 19:25:22 1998
@@ -924,8 +924,12 @@ fhandler_tty_slave::open (const char *na
/* We are now the owner of the handles, and anybody who wants to
open the pty needs to copy them from us, since they are now
closed in the master. FIXME: Needs locking. */
- ttyp->input_handle = get_handle ();
- ttyp->output_handle = output_handle_;
+ DuplicateHandle (GetCurrentProcess (), get_handle (),
+ GetCurrentProcess (), &ttyp->input_handle, 0, TRUE,
+ DUPLICATE_SAME_ACCESS);
+ DuplicateHandle (GetCurrentProcess (), output_handle_,
+ GetCurrentProcess (), &ttyp->output_handle, 0, TRUE,
+ DUPLICATE_SAME_ACCESS);
ttyp->handle_pid = GetCurrentProcessId ();
/* We store the number of open slaves + 1 in slave_handles, so
that we can always tell where the handles are. */
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job
- Raw text -