From 6fb65024a7ebcc5eb5c066583f38a5dde1b2bf4d Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Thu, 14 Oct 1999 08:04:20 +0000 Subject: [PATCH] (proto): be more careful and don't print errno when read() returns 0 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7141 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/rsh/rsh.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appl/rsh/rsh.c b/appl/rsh/rsh.c index f518b99d6..27371f862 100644 --- a/appl/rsh/rsh.c +++ b/appl/rsh/rsh.c @@ -467,10 +467,15 @@ proto (int s, int errsock, return 1; } - if (net_read (s, &reply, 1) != 1) { + ret = net_read (s, &reply, 1); + if (ret < 0) { warn ("read"); close (errsock2); return 1; + } else if (ret == 0) { + warnx ("unexpected EOF from %s", hostname); + close (errsock2); + return 1; } if (reply != 0) {