Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-04-24 06:07:58 +0400
committerChristopher Faylor <me@cgf.cx>2001-04-24 06:07:58 +0400
commitf3ea62a847c523db2437aee6f17d852e3765bf86 (patch)
treef9b8e50ed93f6ca269a06d46449b86e29506cbb7 /winsup/cygwin/fhandler_tty.cc
parent9cf9c146685aaf111b9bf267db771d8905072deb (diff)
Remove trailing underscore from fhandler_base and friends, throughout.
* fhandler.h (fhandler_base::set_open_status): New method. Stores original open status. (fhandler_base::get_open_status): New method. Retrieves original open status. (fhandler_base::reset_to_open_binmode): New method. * fhandler.cc (fhandler_base::open): Save open status. (fhandler_base::init): Ditto. * fhandler_clipboard.cc (fhandler_clipboard::open): Ditto. * fhandler_console.cc (fhandler_console::open): Ditto. * fhandler_dsp.cc (fhandler_dsp::open): Ditto. * fhandler_dev_mem.cc (fhandler_dev_mem::open): Ditto. * fhandler_dev_random.cc (fhandler_dev_random::open): Ditto. * fhandler_serial.cc (fhandler_serial::open): Ditto. * fhandler_tty_slave.cc (fhandler_tty_slave::open): Ditto. * fhandler_tty_master.cc (fhandler_tty_master::open): Ditto. * fhandler_dev_zero.cc (fhandler_dev_zero::open): Ditto. * syscalls.cc (setmode): Rework so that 0 mode value causes reversion to open state. * fhandler_tty_slave.cc (fhandler_tty_slave::read): Use correct multiplier when converting from deciseconds to milliseconds.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r--winsup/cygwin/fhandler_tty.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 0aaf1b978..e33d1d31b 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -420,10 +420,10 @@ fhandler_tty_slave::fhandler_tty_slave (int num, const char *name) :
ttynum = num;
/* FIXME: This is wasteful. We should rewrite the set_name path to eliminate the
need for double allocates. */
- unix_path_name_ = (char *) crealloc (unix_path_name_, strlen (win32_path_name_) + 1);
- strcpy (unix_path_name_, win32_path_name_);
- unix_path_name_[0] = unix_path_name_[4] = '/';
- debug_printf ("unix '%s', win32 '%s'", unix_path_name_, win32_path_name_);
+ unix_path_name = (char *) crealloc (unix_path_name, strlen (win32_path_name) + 1);
+ strcpy (unix_path_name, win32_path_name);
+ unix_path_name[0] = unix_path_name[4] = '/';
+ debug_printf ("unix '%s', win32 '%s'", unix_path_name, win32_path_name);
inuse = NULL;
}
@@ -434,6 +434,8 @@ fhandler_tty_slave::fhandler_tty_slave (const char *name) :
inuse = NULL;
}
+/* FIXME: This function needs to close handles when it has
+ a failing condition. */
int
fhandler_tty_slave::open (const char *, int flags, mode_t)
{
@@ -531,6 +533,7 @@ fhandler_tty_slave::open (const char *, int flags, mode_t)
ProtectHandle1 (nh, to_pty);
CloseHandle (tty_owner);
+ set_open_status ();
termios_printf ("tty%d opened", ttynum);
return 1;
@@ -632,7 +635,7 @@ fhandler_tty_slave::read (void *ptr, size_t len)
if (vmin == 0)
time_to_wait = INFINITE;
else
- time_to_wait = (vtime == 0 ? INFINITE : 10 * vtime);
+ time_to_wait = (vtime == 0 ? INFINITE : 100 * vtime);
}
else
time_to_wait = INFINITE;
@@ -951,6 +954,7 @@ fhandler_pty_master::open (const char *, int flags, mode_t)
cygwin_shared->tty[ttynum]->common_init (this);
inuse = get_ttyp ()->create_inuse (TTY_MASTER_ALIVE, FALSE);
set_flags (flags);
+ set_open_status ();
termios_printf ("opened pty master tty%d<%p>", ttynum, this);
return 1;