aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-20 11:40:15 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-20 11:40:15 +0000
commitb644b175993b90803774859953d18618b921daa9 (patch)
tree4f5753d05d0f35dbc8defae6ee13938ced2aae67 /server.c
parent36475f80e9885588ed6a67f762289f7e56add84f (diff)
downloadrtmux-b644b175993b90803774859953d18618b921daa9.tar.gz
rtmux-b644b175993b90803774859953d18618b921daa9.tar.bz2
rtmux-b644b175993b90803774859953d18618b921daa9.zip
Sync OpenBSD patchset 272:
options_get_number() is relatively expensive and a check for dead panes happens a lot more often than actually finding one, so instead of getting the option for every check, get it for every dead window found.
Diffstat (limited to 'server.c')
-rw-r--r--server.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/server.c b/server.c
index 2354b1fc..0fb8459c 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.172 2009-08-19 09:04:48 nicm Exp $ */
+/* $Id: server.c,v 1.173 2009-08-20 11:40:15 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1109,13 +1109,12 @@ void
server_check_window(struct window *w)
{
struct window_pane *wp, *wq;
+ struct options *oo = &w->options;
struct client *c;
struct session *s;
struct winlink *wl;
u_int i, j;
- int destroyed, flag;
-
- flag = options_get_number(&w->options, "remain-on-exit");
+ int destroyed;
destroyed = 1;
@@ -1128,7 +1127,7 @@ server_check_window(struct window *w)
* the window to be destroyed (or it'll close when the last
* pane dies).
*/
- if (wp->fd == -1 && !flag) {
+ if (wp->fd == -1 && options_get_number(oo, "remain-on-exit")) {
layout_close_pane(wp);
window_remove_pane(w, wp);
server_redraw_window(w);