diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2014-09-13 20:55:33 -0700 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2014-09-14 17:28:54 -0700 |
commit | 665d20f6d7f632b6fae0d5d7d455a0ca59a4ab38 (patch) | |
tree | ea6624e93dc76c2dbbe6ae9c14055738ebe14682 /tty.c | |
parent | 2891a83f4627f7aa36947a0595e92af434b67b4f (diff) |
Add -t,--tty
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |