diff options
author | Christopher Faylor <me@cgf.cx> | 2001-04-28 23:48:28 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-04-28 23:48:28 +0000 |
commit | b98ebf5470da68c0ab4a3877c453ac82c12974ae (patch) | |
tree | b53116bef4a3e4ff86a02d59c3aad37ca7a2cd2c /winsup/cygwin/fhandler_console.cc | |
parent | 0ca66974933232188d8d347b225abacf77d241cf (diff) | |
download | newlib-b98ebf5470da68c0ab4a3877c453ac82c12974ae.zip newlib-b98ebf5470da68c0ab4a3877c453ac82c12974ae.tar.gz newlib-b98ebf5470da68c0ab4a3877c453ac82c12974ae.tar.bz2 |
Throughout, change 'tty_attached' to 'real_tty_attached', for clarity.
Throughout, change 'OutputStopped' to 'output_stopped', for consistency.
* dtable.cc (stdio_init): Set controlling tty if not set by stdio opens.
* exceptions.cc (ctrl_c_handler): Avoid special pgid checking if no tty is
associated with the process.
(Suggested by Tim Baker <dbaker@direct.ca>)
* external.cc (fillout_pinfo): Return actual tty number for ctty.
* fhandler_console.cc (get_tty_stuff): Set ctty when shared memory is
allocated. Accept flags input from open().
(set_console_ctty): New function.
(fhandler_console::open): Pass flags to get_tty_stuff and rely on this function
to set the ctty, if appropriate.
* fhandler_termios.cc (fhandler_termios::set_ctty): Move to tty_min class.
* fhandler_tty.cc (fhandler_tty_slave::open): Use tc field to access
set_ctty().
* tty.h (TTY_CONSOLE): Move to include/sys/cygwin.h.
(tty_min): Add set_ctty class here.
* include/sys/cygwin.h (TTY_CONSOLE): New home here.
* path.cc (symlink_info): Make contents an actual buffer. Pass more flags to
case_check.
(path_conv::check): Reorganize to do parsing based on posix path rather than
native path.
(symlink_info::check): Expect posix path as input. Translate to native path
here. Accept path_conv flags. Stop parsing if not a symlink regardless of
whether previous path was a symlink.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 7a340fe..01d90fe 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -97,10 +97,10 @@ static tty_min NO_COPY *shared_console_info = NULL; /* Allocate and initialize the shared record for the current console. Returns a pointer to shared_console_info. */ -static __inline tty_min * -get_tty_stuff (int force = 0) +static tty_min * +get_tty_stuff (int flags = 0) { - if (shared_console_info && !force) + if (shared_console_info) return shared_console_info; shared_console_info = (tty_min *) open_shared (NULL, cygheap->console_h, @@ -109,9 +109,16 @@ get_tty_stuff (int force = 0) ProtectHandle (cygheap->console_h); shared_console_info->setntty (TTY_CONSOLE); shared_console_info->setsid (myself->sid); + shared_console_info->set_ctty (TTY_CONSOLE, flags); return shared_console_info; } +void +set_console_ctty () +{ + (void) get_tty_stuff (); +} + /* Return the tty structure associated with a given tty number. If the tty number is < 0, just return a dummy record. */ tty_min * @@ -517,7 +524,7 @@ fhandler_console::open (const char *, int flags, mode_t) { HANDLE h; - tcinit (get_tty_stuff ()); + tcinit (get_tty_stuff (flags)); set_io_handle (INVALID_HANDLE_VALUE); set_output_handle (INVALID_HANDLE_VALUE); @@ -561,7 +568,6 @@ fhandler_console::open (const char *, int flags, mode_t) } TTYCLEARF (RSTCONS); - set_ctty (TTY_CONSOLE, flags); set_open_status (); debug_printf ("opened conin$ %p, conout$ %p", get_io_handle (), get_output_handle ()); |