From 8bdfa78a69bf543f55cc05940fa698262fcd1010 Mon Sep 17 00:00:00 2001 From: Pierre Humblet Date: Wed, 12 May 2004 01:44:11 +0000 Subject: 2004-05-12 Pierre Humblet * tty.h: Remove the %d or %x from all cygtty strings. (tty::open_output_mutex): Only declare. (tty::open_input_mutex): Ditto. (tty::open_mutex): New definition. * fhandlet_tty.cc (fhandler_tty_slave::open): Declare buf with size CYG_MAX_PATH and replace __small_printf calls by shared_name. * tty.cc (tty::create_inuse): Ditto. (tty::get_event): Ditto. (tty::common_init): Ditto. (tty::open_output_mutex): New method definition. (tty::open_input_mutex): Ditto. (tty::open_mutex): New method. --- winsup/cygwin/fhandler_tty.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/fhandler_tty.cc') diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 717a9924d..6233971cb 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -466,14 +466,14 @@ fhandler_tty_slave::open (int flags, mode_t) set_flags ((flags & ~O_TEXT) | O_BINARY); /* Create synchronisation events */ - char buf[40]; + char buf[CYG_MAX_PATH]; /* output_done_event may or may not exist. It will exist if the tty was opened by fhandler_tty_master::init, normally called at startup if use_tty is non-zero. It will not exist if this is a pty opened by fhandler_pty_master::open. In the former case, tty output is handled by a separate thread which controls output. */ - __small_sprintf (buf, OUTPUT_DONE_EVENT, get_unit ()); + shared_name (buf, OUTPUT_DONE_EVENT, get_unit ()); output_done_event = OpenEvent (EVENT_ALL_ACCESS, TRUE, buf); if (!(output_mutex = get_ttyp ()->open_output_mutex ())) @@ -488,7 +488,7 @@ fhandler_tty_slave::open (int flags, mode_t) __seterrno (); return 0; } - __small_sprintf (buf, INPUT_AVAILABLE_EVENT, get_unit ()); + shared_name (buf, INPUT_AVAILABLE_EVENT, get_unit ()); if (!(input_available_event = OpenEvent (EVENT_ALL_ACCESS, TRUE, buf))) { termios_printf ("open input event failed, %E"); @@ -498,9 +498,9 @@ fhandler_tty_slave::open (int flags, mode_t) /* The ioctl events may or may not exist. See output_done_event, above. */ - __small_sprintf (buf, IOCTL_REQUEST_EVENT, get_unit ()); + shared_name (buf, IOCTL_REQUEST_EVENT, get_unit ()); ioctl_request_event = OpenEvent (EVENT_ALL_ACCESS, TRUE, buf); - __small_sprintf (buf, IOCTL_DONE_EVENT, get_unit ()); + shared_name (buf, IOCTL_DONE_EVENT, get_unit ()); ioctl_done_event = OpenEvent (EVENT_ALL_ACCESS, TRUE, buf); /* FIXME: Needs a method to eliminate tty races */ -- cgit v1.2.3