[openssh-commits] [openssh] 02/06: partial sync of regress/netcat.c with upstream

git+noreply at mindrot.org git+noreply at mindrot.org
Fri May 29 14:59:14 AEST 2020


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit bf3893dddd35e16def04bf48ed2ee1ad695b8f82
Author: tobias <tobias at openbsd.org>
Date:   Thu Mar 26 10:36:03 2015 +0000

    partial sync of regress/netcat.c with upstream
    
    Check for short writes in fdpass(). Clean up while at it.
    
    ok djm
---
 regress/netcat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/regress/netcat.c b/regress/netcat.c
index 50934f3f..30e49ac0 100644
--- a/regress/netcat.c
+++ b/regress/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.127 2015/02/14 22:40:22 jca Exp $ */
+/* $OpenBSD: netcat.c,v 1.128 2015/03/26 10:36:03 tobias Exp $ */
 /*
  * Copyright (c) 2001 Eric Jackson <ericj at monkey.org>
  *
@@ -1034,17 +1034,17 @@ fdpass(int nfd)
 
 	bzero(&pfd, sizeof(pfd));
 	pfd.fd = STDOUT_FILENO;
+	pfd.events = POLLOUT;
 	for (;;) {
 		r = sendmsg(STDOUT_FILENO, &msg, 0);
 		if (r == -1) {
 			if (errno == EAGAIN || errno == EINTR) {
-				pfd.events = POLLOUT;
 				if (poll(&pfd, 1, -1) == -1)
 					err(1, "poll");
 				continue;
 			}
 			err(1, "sendmsg");
-		} else if (r == -1)
+		} else if (r != 1)
 			errx(1, "sendmsg: unexpected return value %zd", r);
 		else
 			break;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list