]> andersk Git - openssh.git/blobdiff - serverloop.c
- (dtucker) [channels.c configure.ac serverloop.c] Bug #1102: Around AIX
[openssh.git] / serverloop.c
index 021ba68c08d1830dc8183d8c03c75bee21b11abd..c1eb2885341c7c91c58633e25822772d13735eed 100644 (file)
@@ -387,10 +387,15 @@ process_input(fd_set *readset)
 
        /* Read and buffer any available stdout data from the program. */
        if (!fdout_eof && FD_ISSET(fdout, readset)) {
+               errno = 0;
                len = read(fdout, buf, sizeof(buf));
                if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
                        /* do nothing */
+#ifdef PTY_ZEROREAD
                } else if (len <= 0) {
+#else
+               } else if (len < 0 || (len == 0 && errno != 0)) {
+#endif
                        fdout_eof = 1;
                } else {
                        buffer_append(&stdout_buffer, buf, len);
@@ -399,10 +404,15 @@ process_input(fd_set *readset)
        }
        /* Read and buffer any available stderr data from the program. */
        if (!fderr_eof && FD_ISSET(fderr, readset)) {
+               errno = 0;
                len = read(fderr, buf, sizeof(buf));
                if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
                        /* do nothing */
+#ifdef PTY_ZEROREAD
                } else if (len <= 0) {
+#else
+               } else if (len < 0 || (len == 0 && errno != 0)) {
+#endif
                        fderr_eof = 1;
                } else {
                        buffer_append(&stderr_buffer, buf, len);
This page took 0.034199 seconds and 4 git commands to generate.