summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/server.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index ad1bcf5e421..6de31ef2835 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.58 2009/10/12 09:29:58 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.59 2009/10/13 06:14:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1377,6 +1377,11 @@ server_lock_server(void)
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
continue;
+ if (s->flags & SESSION_UNATTACHED) {
+ s->activity = time(NULL);
+ continue;
+ }
+
timeout = options_get_number(&s->options, "lock-after-time");
if (timeout <= 0 || t <= s->activity + timeout)
return; /* not timed out */
@@ -1400,6 +1405,11 @@ server_lock_sessions(void)
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
continue;
+ if (s->flags & SESSION_UNATTACHED) {
+ s->activity = time(NULL);
+ continue;
+ }
+
timeout = options_get_number(&s->options, "lock-after-time");
if (timeout > 0 && t > s->activity + timeout) {
server_lock_session(s);