mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 11:18:48 +00:00
Sync OpenBSD patchset 403:
When a session is unattached, reset its activity timer to prevent it locking instantly when reattached.
This commit is contained in:
parent
fe99f6fa11
commit
941032b707
12
server.c
12
server.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server.c,v 1.209 2009-10-15 01:30:00 tcunha Exp $ */
|
/* $Id: server.c,v 1.210 2009-10-15 01:43:16 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -1380,6 +1380,11 @@ server_lock_server(void)
|
|||||||
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
|
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (s->flags & SESSION_UNATTACHED) {
|
||||||
|
s->activity = time(NULL);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
timeout = options_get_number(&s->options, "lock-after-time");
|
timeout = options_get_number(&s->options, "lock-after-time");
|
||||||
if (timeout <= 0 || t <= s->activity + timeout)
|
if (timeout <= 0 || t <= s->activity + timeout)
|
||||||
return; /* not timed out */
|
return; /* not timed out */
|
||||||
@ -1403,6 +1408,11 @@ server_lock_sessions(void)
|
|||||||
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
|
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (s->flags & SESSION_UNATTACHED) {
|
||||||
|
s->activity = time(NULL);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
timeout = options_get_number(&s->options, "lock-after-time");
|
timeout = options_get_number(&s->options, "lock-after-time");
|
||||||
if (timeout > 0 && t > s->activity + timeout) {
|
if (timeout > 0 && t > s->activity + timeout) {
|
||||||
server_lock_session(s);
|
server_lock_session(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user