Do not care about the server socket closing if exiting anyway.
authornicm <nicm@openbsd.org>
Fri, 12 Feb 2021 06:52:48 +0000 (06:52 +0000)
committernicm <nicm@openbsd.org>
Fri, 12 Feb 2021 06:52:48 +0000 (06:52 +0000)
usr.bin/tmux/client.c
usr.bin/tmux/file.c

index d9bd79f..0004d97 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.153 2021/02/11 09:39:29 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.154 2021/02/12 06:52:48 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -553,8 +553,10 @@ static void
 client_dispatch(struct imsg *imsg, __unused void *arg)
 {
        if (imsg == NULL) {
-               client_exitreason = CLIENT_EXIT_LOST_SERVER;
-               client_exitval = 1;
+               if (!client_exitflag) {
+                       client_exitreason = CLIENT_EXIT_LOST_SERVER;
+                       client_exitval = 1;
+               }
                proc_exit(client_proc);
                return;
        }
index 8c3d7aa..7a3d86e 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.9 2021/02/11 09:39:29 nicm Exp $ */
+/* $OpenBSD: file.c,v 1.10 2021/02/12 06:52:48 nicm Exp $ */
 
 /*
  * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -485,7 +485,7 @@ file_write_left(struct client_files *files)
        size_t                   left;
        int                      waiting = 0;
 
-       RB_FOREACH (cf, client_files, files) {
+       RB_FOREACH(cf, client_files, files) {
                if (cf->event == NULL)
                        continue;
                left = EVBUFFER_LENGTH(cf->event->output);