summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <cgf@redhat.com>2003-03-04 17:26:32 +0000
committerChristopher Faylor <cgf@redhat.com>2003-03-04 17:26:32 +0000
commit542601febcf8abfe74acd8761917bda100b117dd (patch)
treead6b8e17b63f1ca66f816dddf099aa9676ed0a17
parent63a9db1dc04da87f238d74afccca5ece5d171aa3 (diff)
downloadgdb-542601febcf8abfe74acd8761917bda100b117dd.tar.gz
merge from trunk
-rw-r--r--winsup/cygwin/ChangeLog24
-rw-r--r--winsup/cygwin/fhandler.h3
-rw-r--r--winsup/cygwin/fhandler_socket.cc1
-rw-r--r--winsup/cygwin/fhandler_tty.cc38
4 files changed, 66 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ed3e4c66716..f1e9471b538 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,27 @@
+2003-03-04 Jason Tishler <jason@tishler.net>
+
+ * fhandler_socket.cc (fhandler_socket::dup): Initialize type.
+
+2003-03-03 Christopher Faylor <cgf@redhat.com>
+
+ * fhandler.h (fhandler_tty_slave::close): Declare new function.
+ (fhandler_tty_slave::dup): Declare new function.
+ (fhandler_tty_slave::fixup_after_function): Declare new function.
+ * fhandler_tty.cc (fhandler_tty_slave_open): Only increment
+ fhandler_console::open_fhs when associated with a pty.
+ (fhandler_tty_slave::close): Define new function. Decrement
+ fhandler_console::open_fhs when associated with a pty.
+ (fhandler_tty_slave::dup): Define new function. Increment
+ fhandler_console::open_fhs when associated with a pty.
+ (fhandler_tty_slave::fixup_after_fork): Define new function. Increment
+ fhandler_console::open_fhs when associated with a pty.
+
+2003-03-03 Christopher Faylor <cgf@redhat.com>
+
+ * fhandler_tty.cc (fhandler_pty_slave::open): Grudgingly increment
+ fhandler_console::open_fhs here.
+ (fhandler_pty_slave::close): Ditto for close.
+
2003-03-02 Christopher Faylor <cgf@redhat.com>
* lib/getopt.c: Refresh from NetBSD sources.
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 7461efced51..918043f08e1 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -893,6 +893,9 @@ class fhandler_tty_slave: public fhandler_tty_common
int tcgetattr (struct termios *t);
int tcflush (int);
int ioctl (unsigned int cmd, void *);
+ int close ();
+ int dup (fhandler_base *child);
+ void fixup_after_fork (HANDLE parent);
__off64_t lseek (__off64_t, int) { return 0; }
select_record *select_read (select_record *s);
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index c87790ec679..39777caa30a 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -391,6 +391,7 @@ fhandler_socket::dup (fhandler_base *child)
fhs->set_io_handle (get_io_handle ());
if (get_addr_family () == AF_LOCAL)
fhs->set_sun_path (get_sun_path ());
+ fhs->set_socket_type (get_socket_type ());
fhs->fixup_before_fork_exec (GetCurrentProcessId ());
if (winsock2_active)
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 395c4fc9719..8d9ff4bc5a0 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -552,12 +552,28 @@ fhandler_tty_slave::open (int flags, mode_t)
set_output_handle (to_master_local);
set_open_status ();
+ if (!output_done_event)
+ {
+ fhandler_console::open_fhs++;
+ termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
+ }
termios_printf ("tty%d opened", get_unit ());
return 1;
}
int
+fhandler_tty_slave::close ()
+{
+ if (!output_done_event)
+ {
+ fhandler_console::open_fhs--;
+ termios_printf ("decremeted open_fhs %d", fhandler_console::open_fhs);
+ }
+ return fhandler_tty_common::close ();
+}
+
+int
fhandler_tty_slave::cygserver_attach_tty (LPHANDLE from_master_ptr,
LPHANDLE to_master_ptr)
{
@@ -814,6 +830,17 @@ fhandler_tty_slave::read (void *ptr, size_t& len)
}
int
+fhandler_tty_slave::dup (fhandler_base *child)
+{
+ if (!output_done_event)
+ {
+ fhandler_console::open_fhs++;
+ termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
+ }
+ return fhandler_tty_common::dup (child);
+}
+
+int
fhandler_tty_common::dup (fhandler_base *child)
{
fhandler_tty_slave *fts = (fhandler_tty_slave *) child;
@@ -1202,6 +1229,17 @@ fhandler_tty_common::set_close_on_exec (int val)
}
void
+fhandler_tty_slave::fixup_after_fork (HANDLE parent)
+{
+ if (!output_done_event)
+ {
+ fhandler_console::open_fhs++;
+ termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
+ }
+ fhandler_tty_common::fixup_after_fork (parent);
+}
+
+void
fhandler_tty_common::fixup_after_fork (HANDLE parent)
{
fhandler_termios::fixup_after_fork (parent);