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/tty.h | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'winsup/cygwin/tty.h') diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h index 94d98048b..d29b2e903 100644 --- a/winsup/cygwin/tty.h +++ b/winsup/cygwin/tty.h @@ -8,7 +8,6 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ - /* tty tables */ #define INP_BUFFER_SIZE 256 @@ -18,15 +17,15 @@ details. */ /* Input/Output/ioctl events */ -#define OUTPUT_DONE_EVENT "cygtty%d.output.done" -#define IOCTL_REQUEST_EVENT "cygtty%d.ioctl.request" -#define IOCTL_DONE_EVENT "cygtty%d.ioctl.done" -#define RESTART_OUTPUT_EVENT "cygtty%d.output.restart" -#define INPUT_AVAILABLE_EVENT "cygtty%d.input.avail" -#define OUTPUT_MUTEX "cygtty%d.output.mutex" -#define INPUT_MUTEX "cygtty%d.input.mutex" -#define TTY_SLAVE_ALIVE "cygtty%x.slave_alive" -#define TTY_MASTER_ALIVE "cygtty%x.master_alive" +#define OUTPUT_DONE_EVENT "cygtty.output.done" +#define IOCTL_REQUEST_EVENT "cygtty.ioctl.request" +#define IOCTL_DONE_EVENT "cygtty.ioctl.done" +#define RESTART_OUTPUT_EVENT "cygtty.output.restart" +#define INPUT_AVAILABLE_EVENT "cygtty.input.avail" +#define OUTPUT_MUTEX "cygtty.output.mutex" +#define INPUT_MUTEX "cygtty.input.mutex" +#define TTY_SLAVE_ALIVE "cygtty.slave_alive" +#define TTY_MASTER_ALIVE "cygtty.master_alive" #include @@ -105,18 +104,9 @@ public: HWND gethwnd () {return hwnd;} void sethwnd (HWND wnd) {hwnd = wnd;} bool make_pipes (fhandler_pty_master *ptym); - HANDLE open_output_mutex () - { - char buf[80]; - __small_sprintf (buf, OUTPUT_MUTEX, ntty); - return OpenMutex (MUTEX_ALL_ACCESS, TRUE, buf); - } - HANDLE open_input_mutex () - { - char buf[80]; - __small_sprintf (buf, INPUT_MUTEX, ntty); - return OpenMutex (MUTEX_ALL_ACCESS, TRUE, buf); - } + HANDLE open_mutex (const char *mutex); + HANDLE open_output_mutex (); + HANDLE open_input_mutex (); bool exists () { HANDLE h = open_output_mutex (); -- cgit v1.2.3