Skip to content

Commit

Permalink
Open /dev/tty/ in read and append mode.
Browse files Browse the repository at this point in the history
This avoids illegal seek errors when users send input while we're
outputting to the terminal.

Closes #42.
  • Loading branch information
calleluks committed Mar 9, 2015
1 parent f0ebefe commit cbfa26f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void
start_ui()
{
struct termios newattr;
if ((tty = fopen("/dev/tty", "w+")) == NULL) {
if ((tty = fopen("/dev/tty", "a+")) == NULL) {
err(1, "fopen");
}
tcgetattr(fileno(tty), &oldattr);
Expand Down

0 comments on commit cbfa26f

Please sign in to comment.