mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-24 14:21:00 +01:00
Sync OpenBSD patchset 682:
If remain-on-exit is set, both the error callback and a SIGCHLD could destroy the same pane (because the first one doesn't remove it from the list of panes), causing the pane bufferevent to be freed twice. So don't free it if the fd has already been set to -1, from Romain Francoise.
This commit is contained in:
parent
c0f03afbac
commit
b03418fc6b
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server-fn.c,v 1.104 2010-04-06 21:45:36 nicm Exp $ */
|
/* $Id: server-fn.c,v 1.105 2010-04-18 15:10:55 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -325,9 +325,11 @@ server_destroy_pane(struct window_pane *wp)
|
|||||||
{
|
{
|
||||||
struct window *w = wp->window;
|
struct window *w = wp->window;
|
||||||
|
|
||||||
|
if (wp->fd != -1) {
|
||||||
close(wp->fd);
|
close(wp->fd);
|
||||||
bufferevent_free(wp->event);
|
bufferevent_free(wp->event);
|
||||||
wp->fd = -1;
|
wp->fd = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (options_get_number(&w->options, "remain-on-exit"))
|
if (options_get_number(&w->options, "remain-on-exit"))
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user