summaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2014-09-13 20:55:33 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2014-09-14 17:28:54 -0700
commit665d20f6d7f632b6fae0d5d7d455a0ca59a4ab38 (patch)
treeea6624e93dc76c2dbbe6ae9c14055738ebe14682 /tty.c
parent2891a83f4627f7aa36947a0595e92af434b67b4f (diff)
Add -t,--tty
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tty.c b/tty.c
index 288a5b8..274f88c 100644
--- a/tty.c
+++ b/tty.c
@@ -10,9 +10,9 @@ void tty_reset(tty_t *tty){
tcsetattr(tty->fdin, TCSANOW, &tty->original_termios);
}
-void tty_init(tty_t *tty){
- tty->fdin = open("/dev/tty", O_RDONLY);
- tty->fout = fopen("/dev/tty", "w");
+void tty_init(tty_t *tty, const char *tty_filename){
+ tty->fdin = open(tty_filename, O_RDONLY);
+ tty->fout = fopen(tty_filename, "w");
setvbuf(tty->fout, NULL, _IOFBF, 4096);
tcgetattr(tty->fdin, &tty->original_termios);