mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
Check for already locked/suspended clients in server_lock_client rather than
its callers.
This commit is contained in:
parent
205857b232
commit
c734789b18
@ -164,8 +164,6 @@ server_lock(void)
|
|||||||
c = ARRAY_ITEM(&clients, i);
|
c = ARRAY_ITEM(&clients, i);
|
||||||
if (c == NULL || c->session == NULL)
|
if (c == NULL || c->session == NULL)
|
||||||
continue;
|
continue;
|
||||||
if (c->flags & CLIENT_SUSPENDED)
|
|
||||||
continue;
|
|
||||||
server_lock_client(c);
|
server_lock_client(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,8 +178,6 @@ server_lock_session(struct session *s)
|
|||||||
c = ARRAY_ITEM(&clients, i);
|
c = ARRAY_ITEM(&clients, i);
|
||||||
if (c == NULL || c->session == NULL || c->session != s)
|
if (c == NULL || c->session == NULL || c->session != s)
|
||||||
continue;
|
continue;
|
||||||
if (c->flags & CLIENT_SUSPENDED)
|
|
||||||
continue;
|
|
||||||
server_lock_client(c);
|
server_lock_client(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,6 +189,9 @@ server_lock_client(struct client *c)
|
|||||||
size_t cmdlen;
|
size_t cmdlen;
|
||||||
struct msg_lock_data lockdata;
|
struct msg_lock_data lockdata;
|
||||||
|
|
||||||
|
if (c->flags & CLIENT_SUSPENDED)
|
||||||
|
return;
|
||||||
|
|
||||||
cmd = options_get_string(&c->session->options, "lock-command");
|
cmd = options_get_string(&c->session->options, "lock-command");
|
||||||
cmdlen = strlcpy(lockdata.cmd, cmd, sizeof lockdata.cmd);
|
cmdlen = strlcpy(lockdata.cmd, cmd, sizeof lockdata.cmd);
|
||||||
if (cmdlen >= sizeof lockdata.cmd)
|
if (cmdlen >= sizeof lockdata.cmd)
|
||||||
|
Loading…
Reference in New Issue
Block a user