Sync OpenBSD patchset 496:

Switch window pane pipe redirect fd over to a bufferevent.
This commit is contained in:
Tiago Cunha
2009-11-08 22:59:53 +00:00
parent 971a7b2fe0
commit cb0bf6a043
4 changed files with 29 additions and 32 deletions

View File

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.118 2009-11-08 22:40:36 tcunha Exp $ */
/* $Id: window.c,v 1.119 2009-11-08 22:59:53 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -424,8 +424,8 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp->sy = sy;
wp->pipe_fd = -1;
wp->pipe_buf = NULL;
wp->pipe_off = 0;
wp->pipe_event = NULL;
wp->saved_grid = NULL;
@ -451,9 +451,8 @@ window_pane_destroy(struct window_pane *wp)
grid_destroy(wp->saved_grid);
if (wp->pipe_fd != -1) {
buffer_destroy(wp->pipe_buf);
close(wp->pipe_fd);
event_del(&wp->pipe_event);
bufferevent_free(wp->pipe_event);
}
buffer_destroy(wp->in);
@ -646,7 +645,7 @@ window_pane_parse(struct window_pane *wp)
new_size = BUFFER_USED(wp->in) - wp->pipe_off;
if (wp->pipe_fd != -1 && new_size > 0)
buffer_write(wp->pipe_buf, BUFFER_OUT(wp->in), new_size);
bufferevent_write(wp->pipe_event, BUFFER_OUT(wp->in), new_size);
input_parse(wp);