Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-server/pull/179#discussion_r208997209
--- Diff: src/guacd/connection.c ---
@@ -70,7 +70,7 @@ static int __write_all(int fd, char* buffer, int length) {
while (length > 0) {
int written = write(fd, buffer, length);
- if (written < 0)
+ if (written < 0 || errno > 0)
--- End diff --
The contents of `errno` are not defined for a successful call to `write()`.
I don't believe the standard allows us to rely on checking solely `errno` to
determine whether `write()` failed.
---