On Posix: Don't shutdown (half) the connection from the client.

This triggered POLLHUP too early on Mac.
This commit is contained in:
Mara Bos
2018-11-14 17:36:29 +01:00
committed by Julian Oes
parent d7c34ddee4
commit c882ca9389
2 changed files with 3 additions and 8 deletions
+3 -2
View File
@@ -220,14 +220,15 @@ void
cmd.resize(n + 1024);
ssize_t n_read = read(fd, &cmd[n], cmd.size() - n);
if (n_read < 0) {
if (n_read <= 0) {
_cleanup(fd);
return nullptr;
}
cmd.resize(n + n_read);
if (n_read == 0) {
// Command ends in 0x00 (no tty) or 0x01 (tty).
if (!cmd.empty() && cmd.back() < 2) {
break;
}
}