=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- src/usr.bin/tmux/tty.c 2010/02/01 23:06:24 1.83 +++ src/usr.bin/tmux/tty.c 2010/02/24 19:08:39 1.84 @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.83 2010/02/01 23:06:24 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.84 2010/02/24 19:08:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -213,10 +213,6 @@ * because the fd is invalid. Things like ssh -t can easily leave us * with a dead tty. */ - if ((mode = fcntl(tty->fd, F_GETFL)) == -1) - return; - if (fcntl(tty->fd, F_SETFL, mode & ~O_NONBLOCK) == -1) - return; if (ioctl(tty->fd, TIOCGWINSZ, &ws) == -1) return; if (tcsetattr(tty->fd, TCSANOW, &tty->tio) == -1) @@ -233,6 +229,9 @@ tty_raw(tty, "\033[?1000l"); tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP)); + + if ((mode = fcntl(tty->fd, F_GETFL)) != -1) + fcntl(tty->fd, F_SETFL, mode & ~O_NONBLOCK); } void