29 lines
708 B
Diff
29 lines
708 B
Diff
From 98e293c54aa08cbee14674c82159d851bd8b9d56 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= <mat@brain-dump.org>
|
|
Date: Sat, 17 Mar 2018 10:32:40 +0100
|
|
Subject: [PATCH 4/4] Correct EOF handling on client stdin
|
|
|
|
Previously we would end in an infinite loop which might be the cause
|
|
of #15.
|
|
---
|
|
client.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git client.c client.c
|
|
index f26bc8f..6cf70c7 100644
|
|
--- a/client.c
|
|
+++ b/client.c
|
|
@@ -129,6 +129,9 @@ static int client_mainloop(void) {
|
|
} else if (!(client.flags & CLIENT_READONLY)) {
|
|
client_send_packet(&pkt);
|
|
}
|
|
+ } else if (len == 0) {
|
|
+ debug("client-stdin: EOF\n");
|
|
+ return -1;
|
|
}
|
|
}
|
|
}
|
|
--
|
|
2.24.0
|
|
|