summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 973f0c40a65..f13b3b98bd2 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.93 2010/09/26 18:51:48 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.94 2010/09/26 20:43:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -222,15 +222,17 @@ server_loop(void)
}
}
-/* Check if the server should be shutting down (no more clients or windows). */
+/* Check if the server should be shutting down (no more clients or sessions). */
int
server_should_shutdown(void)
{
u_int i;
- for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
- if (ARRAY_ITEM(&sessions, i) != NULL)
- return (0);
+ if (!options_get_number(&global_options, "exit-unattached")) {
+ for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
+ if (ARRAY_ITEM(&sessions, i) != NULL)
+ return (0);
+ }
}
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
if (ARRAY_ITEM(&clients, i) != NULL)