From 9d03e48ee3938f877010f2beffb64db60ba97f2f Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 13 Jul 2014 20:23:10 +0000 Subject: [PATCH] If a client is killed while suspended with ^Z so has gone through the MSG_EXITED dance, don't try to resume it since a) it's pointless and b) the tty structures have been cleaned up and tmux will crash. --- usr.bin/tmux/server-client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 73e061a1e80..856df3d3d1a 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.120 2014/04/16 08:02:31 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.121 2014/07/13 20:23:10 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -875,6 +875,9 @@ server_client_msg_dispatch(struct client *c) break; c->flags &= ~CLIENT_SUSPENDED; + if (c->tty.fd == -1) /* exited in the meantime */ + break; + if (gettimeofday(&c->activity_time, NULL) != 0) fatal("gettimeofday"); if (c->session != NULL) -- 2.20.1