summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-06-26 23:55:51 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-06-26 23:55:51 +0000
commit981625647a499bfd4ede14527cae87af790b1001 (patch)
treeae4a8eeabbb0e5d65a4e1ef40bb964b93c612cdc /usr.bin/tmux
parent17082682bc53f46c57a99c9067bb95d4762793cd (diff)
Use server_destroy_session() for kill-session.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-kill-session.c14
-rw-r--r--usr.bin/tmux/server-fn.c3
2 files changed, 4 insertions, 13 deletions
diff --git a/usr.bin/tmux/cmd-kill-session.c b/usr.bin/tmux/cmd-kill-session.c
index 251779ab971..6b778ce2f5f 100644
--- a/usr.bin/tmux/cmd-kill-session.c
+++ b/usr.bin/tmux/cmd-kill-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-kill-session.c,v 1.6 2009/12/03 22:50:10 nicm Exp $ */
+/* $OpenBSD: cmd-kill-session.c,v 1.7 2010/06/26 23:55:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -45,21 +45,11 @@ cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
struct session *s;
- struct client *c;
- u_int i;
if ((s = cmd_find_session(ctx, data->target)) == NULL)
return (-1);
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
- if (c != NULL && c->session == s) {
- c->session = NULL;
- server_write_client(c, MSG_EXIT, NULL, 0);
- }
- }
- recalculate_sizes();
-
+ server_destroy_session(s);
session_destroy(s);
return (0);
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c
index c7d943dc6b4..155bdfe380d 100644
--- a/usr.bin/tmux/server-fn.c
+++ b/usr.bin/tmux/server-fn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-fn.c,v 1.37 2010/06/21 01:27:46 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.38 2010/06/26 23:55:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -371,6 +371,7 @@ server_destroy_session(struct session *s)
c->session = NULL;
server_write_client(c, MSG_EXIT, NULL, 0);
}
+ recalculate_sizes();
}
void