aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-14 21:17:54 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-14 21:17:54 +0000
commit5cc971facd30171a03267faf2ca9a875df824b0f (patch)
tree949894dd8a1eb7c7a515a4bf5594b373d780bc33 /tty.c
parentb402cef338e863ffe503f2fcdce3fb44d879efbf (diff)
downloadrtmux-5cc971facd30171a03267faf2ca9a875df824b0f.tar.gz
rtmux-5cc971facd30171a03267faf2ca9a875df824b0f.tar.bz2
rtmux-5cc971facd30171a03267faf2ca9a875df824b0f.zip
Sync OpenBSD patchset 244:
Drop the no_stop argument to tty_close and tty_free in favour of a flag in the tty struct.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/tty.c b/tty.c
index 95aee805..691a1121 100644
--- a/tty.c
+++ b/tty.c
@@ -1,4 +1,4 @@
-/* $Id: tty.c,v 1.122 2009-08-09 17:28:24 tcunha Exp $ */
+/* $Id: tty.c,v 1.123 2009-08-14 21:17:54 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -153,6 +153,8 @@ tty_start_tty(struct tty *tty)
tty->rupper = UINT_MAX;
tty->mode = MODE_CURSOR;
+
+ tty->flags |= TTY_STARTED;
}
void
@@ -160,6 +162,10 @@ tty_stop_tty(struct tty *tty)
{
struct winsize ws;
+ if (!(tty->flags & TTY_STARTED))
+ return;
+ tty->flags &= ~TTY_STARTED;
+
/*
* Be flexible about error handling and try not kill the server just
* because the fd is invalid. Things like ssh -t can easily leave us
@@ -291,7 +297,7 @@ tty_get_acs(struct tty *tty, u_char ch)
}
void
-tty_close(struct tty *tty, int no_stop)
+tty_close(struct tty *tty)
{
if (tty->fd == -1)
return;
@@ -301,8 +307,7 @@ tty_close(struct tty *tty, int no_stop)
tty->log_fd = -1;
}
- if (!no_stop)
- tty_stop_tty(tty);
+ tty_stop_tty(tty);
tty_term_free(tty->term);
tty_keys_free(tty);
@@ -315,9 +320,9 @@ tty_close(struct tty *tty, int no_stop)
}
void
-tty_free(struct tty *tty, int no_stop)
+tty_free(struct tty *tty)
{
- tty_close(tty, no_stop);
+ tty_close(tty);
if (tty->path != NULL)
xfree(tty->path);