From 1100f7a5cdf36d5aa07cf69209ea6ee6acf348be Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Fri, 19 Jan 1996 15:52:55 +0000 Subject: [PATCH] In des_read, check to see if read returns 0 and report a closed connection if it does. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7339 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 4 ++++ src/appl/bsd/krlogin.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 4e2f94298..c319837e9 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,7 @@ +Fri Jan 19 10:45:29 1996 Sam Hartman + + * krlogin.c (des_read): Return 0 or -1 on close/error respectively. + Wed Jan 17 15:14:33 1996 Sam Hartman * krlogin.c ((reader): Use select to find out-of-band data, not signals. diff --git a/src/appl/bsd/krlogin.c b/src/appl/bsd/krlogin.c index 00f3e765c..0807cd594 100644 --- a/src/appl/bsd/krlogin.c +++ b/src/appl/bsd/krlogin.c @@ -1624,7 +1624,7 @@ int des_read(fd, buf, len) cc = krb5_net_read(bsd_context, fd, &c, 1); /* we should check for non-blocking here, but we'd have to make it save partial reads as well. */ - if (cc < 0) return 0; /* read error */ + if (cc <= 0) return cc; /* read error */ if (cc == 1) { if (c == 0) gotzero = 1; } -- 2.26.2