summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-10-04 10:55:31 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-10-04 10:55:31 +0000
commit16de74a6e8d81c600d3ac4d1728534073077b2ec (patch)
tree513cd21ed3259a8222c2ad745263910098512cb4 /usr.bin
parent4658564327f04e25e647880c251db0070641ca2f (diff)
Check for already locked/suspended clients in server_lock_client rather than
its callers.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/server-fn.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c
index 1a0f0a6aa3d..dadc2b6c003 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.23 2009/09/24 14:17:09 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.24 2009/10/04 10:55:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -164,8 +164,6 @@ server_lock(void)
c = ARRAY_ITEM(&clients, i);
if (c == NULL || c->session == NULL)
continue;
- if (c->flags & CLIENT_SUSPENDED)
- continue;
server_lock_client(c);
}
}
@@ -180,8 +178,6 @@ server_lock_session(struct session *s)
c = ARRAY_ITEM(&clients, i);
if (c == NULL || c->session == NULL || c->session != s)
continue;
- if (c->flags & CLIENT_SUSPENDED)
- continue;
server_lock_client(c);
}
}
@@ -193,6 +189,9 @@ server_lock_client(struct client *c)
size_t cmdlen;
struct msg_lock_data lockdata;
+ if (c->flags & CLIENT_SUSPENDED)
+ return;
+
cmd = options_get_string(&c->session->options, "lock-command");
cmdlen = strlcpy(lockdata.cmd, cmd, sizeof lockdata.cmd);
if (cmdlen >= sizeof lockdata.cmd)