summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authornicm <nicm>2021-02-11 09:39:29 +0000
committernicm <nicm>2021-02-11 09:39:29 +0000
commit2b58c226db055eff4bbb971fa00938b42690f4ac (patch)
tree99ef851469726bd9f6f7f6087cce68cd660a0b67 /client.c
parent79e1984962281d94b25ff14ac3de31bc63358ead (diff)
Add a couple of helper functions, and flush imsgs on exit.
Diffstat (limited to 'client.c')
-rw-r--r--client.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/client.c b/client.c
index e164e930..74dc4602 100644
--- a/client.c
+++ b/client.c
@@ -223,20 +223,7 @@ client_exit_message(void)
static void
client_exit(void)
{
- struct client_file *cf;
- size_t left;
- int waiting = 0;
-
- RB_FOREACH (cf, client_files, &client_files) {
- if (cf->event == NULL)
- continue;
- left = EVBUFFER_LENGTH(cf->event->output);
- if (left != 0) {
- waiting++;
- log_debug("file %u %zu bytes left", cf->stream, left);
- }
- }
- if (waiting == 0)
+ if (!file_write_left(&client_files))
proc_exit(client_proc);
}