=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- src/usr.bin/tmux/window.c 2010/12/30 21:35:17 1.61 +++ src/usr.bin/tmux/window.c 2011/01/08 01:52:37 1.62 @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.61 2010/12/30 21:35:17 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.62 2011/01/08 01:52:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -563,7 +563,6 @@ const char *cwd, struct environ *env, struct termios *tio, char **cause) { struct winsize ws; - int mode; char *argv0; const char *ptr; struct termios tio2; @@ -637,10 +636,8 @@ fatal("execl failed"); } - if ((mode = fcntl(wp->fd, F_GETFL)) == -1) - fatal("fcntl failed"); - if (fcntl(wp->fd, F_SETFL, mode|O_NONBLOCK) == -1) - fatal("fcntl failed"); + setblocking(wp->fd, 0); + wp->event = bufferevent_new(wp->fd, window_pane_read_callback, NULL, window_pane_error_callback, wp); bufferevent_enable(wp->event, EV_READ|EV_WRITE);