summaryrefslogtreecommitdiffstats
path: root/server.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-09-13 20:37:37 +0000
committerTiago Cunha <tcunha@gmx.com>2009-09-13 20:37:37 +0000
commit69e7f4af1924343d876214a36e3771a7815d3519 (patch)
treeec4e6fba0a43f2ccf00dca4f0ede3f329e0dd135 /server.c
parent61990deb361983589eafb5779344f3981905194a (diff)
Sync OpenBSD patchset 324:
Tidy some common code for destroying sessions into a new function.
Diffstat (limited to 'server.c')
-rw-r--r--server.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/server.c b/server.c
index 4d8fccaa..3979fb2e 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.184 2009-09-11 14:13:52 tcunha Exp $ */
+/* $Id: server.c,v 1.185 2009-09-13 20:37:37 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1214,21 +1214,11 @@ server_check_window(struct window *w)
RB_FOREACH(wl, winlinks, &s->windows) {
if (wl->window != w)
continue;
- destroyed = session_detach(s, wl);
- for (j = 0; j < ARRAY_LENGTH(&clients); j++) {
- c = ARRAY_ITEM(&clients, j);
- if (c == NULL || c->session != s)
- continue;
- if (!destroyed) {
- server_redraw_client(c);
- continue;
- }
- c->session = NULL;
- server_write_client(c, MSG_EXIT, NULL, 0);
- }
- /* If the session was destroyed, bail now. */
- if (destroyed)
+ if (session_detach(s, wl)) {
+ server_destroy_session(s);
break;
+ }
+ server_redraw_session(s);
goto restart;
}
}