View | Details | Raw Unified | Return to bug 1102 | Differences between
and this patch

Collapse All | Expand All

(-)channels.c (+5 lines)
Lines 1415-1424 channel_handle_rfd(Channel *c, fd_set *r Link Here
1415
1415
1416
	if (c->rfd != -1 &&
1416
	if (c->rfd != -1 &&
1417
	    FD_ISSET(c->rfd, readset)) {
1417
	    FD_ISSET(c->rfd, readset)) {
1418
		errno = 0;
1418
		len = read(c->rfd, buf, sizeof(buf));
1419
		len = read(c->rfd, buf, sizeof(buf));
1419
		if (len < 0 && (errno == EINTR || errno == EAGAIN))
1420
		if (len < 0 && (errno == EINTR || errno == EAGAIN))
1420
			return 1;
1421
			return 1;
1422
#ifndef PTY_ZEROREAD
1421
		if (len <= 0) {
1423
		if (len <= 0) {
1424
#else
1425
		if (len < 0 || (len == 0 && errno != 0)) {
1426
#endif
1422
			debug2("channel %d: read<=0 rfd %d len %d",
1427
			debug2("channel %d: read<=0 rfd %d len %d",
1423
			    c->self, c->rfd, len);
1428
			    c->self, c->rfd, len);
1424
			if (c->type != SSH_CHANNEL_OPEN) {
1429
			if (c->type != SSH_CHANNEL_OPEN) {
(-)configure.ac (+1 lines)
Lines 190-195 case "$host" in Link Here
190
		supported by bsd-setproctitle.c])
190
		supported by bsd-setproctitle.c])
191
	AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
191
	AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
192
	    [AIX 5.2 and 5.3 (and presumably newer) require this])
192
	    [AIX 5.2 and 5.3 (and presumably newer) require this])
193
	AC_DEFINE(PTY_ZEROREAD, 1, [read(1) can return 0 for a non-closed fd])
193
	;;
194
	;;
194
*-*-cygwin*)
195
*-*-cygwin*)
195
	check_for_libcrypt_later=1
196
	check_for_libcrypt_later=1
(-)serverloop.c (+10 lines)
Lines 387-396 process_input(fd_set *readset) Link Here
387
387
388
	/* Read and buffer any available stdout data from the program. */
388
	/* Read and buffer any available stdout data from the program. */
389
	if (!fdout_eof && FD_ISSET(fdout, readset)) {
389
	if (!fdout_eof && FD_ISSET(fdout, readset)) {
390
		errno = 0;
390
		len = read(fdout, buf, sizeof(buf));
391
		len = read(fdout, buf, sizeof(buf));
391
		if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
392
		if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
392
			/* do nothing */
393
			/* do nothing */
394
#ifdef PTY_ZEROREAD
393
		} else if (len <= 0) {
395
		} else if (len <= 0) {
396
#else
397
		} else if (len < 0 || (len == 0 && errno != 0)) {
398
#endif
394
			fdout_eof = 1;
399
			fdout_eof = 1;
395
		} else {
400
		} else {
396
			buffer_append(&stdout_buffer, buf, len);
401
			buffer_append(&stdout_buffer, buf, len);
Lines 399-408 process_input(fd_set *readset) Link Here
399
	}
404
	}
400
	/* Read and buffer any available stderr data from the program. */
405
	/* Read and buffer any available stderr data from the program. */
401
	if (!fderr_eof && FD_ISSET(fderr, readset)) {
406
	if (!fderr_eof && FD_ISSET(fderr, readset)) {
407
		errno = 0;
402
		len = read(fderr, buf, sizeof(buf));
408
		len = read(fderr, buf, sizeof(buf));
403
		if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
409
		if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
404
			/* do nothing */
410
			/* do nothing */
411
#ifdef PTY_ZEROREAD
405
		} else if (len <= 0) {
412
		} else if (len <= 0) {
413
#else
414
		} else if (len < 0 || (len == 0 && errno != 0)) {
415
#endif
406
			fderr_eof = 1;
416
			fderr_eof = 1;
407
		} else {
417
		} else {
408
			buffer_append(&stderr_buffer, buf, len);
418
			buffer_append(&stderr_buffer, buf, len);

Return to bug 1102