diff options
author | peter <peter@FreeBSD.org> | 1999-02-07 09:40:41 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-02-07 09:40:41 +0000 |
commit | 19c8fca2df7a6f39e5208229f428ec269fb3adbf (patch) | |
tree | 880a7cd01e2b6a0483601535c1a4c1b63a131b51 /contrib/sendmail/src/util.c | |
parent | d7ac03c10c41129058bfcad4473d778394642703 (diff) | |
download | FreeBSD-src-19c8fca2df7a6f39e5208229f428ec269fb3adbf.zip FreeBSD-src-19c8fca2df7a6f39e5208229f428ec269fb3adbf.tar.gz |
Import sendmail 8.9.3 onto vendor branch, replacing previous interim
8.9.2 + patches version.
Obtained from: ftp.sendmail.org
Diffstat (limited to 'contrib/sendmail/src/util.c')
-rw-r--r-- | contrib/sendmail/src/util.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c index 785d362..0cb8992 100644 --- a/contrib/sendmail/src/util.c +++ b/contrib/sendmail/src/util.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)util.c 8.167 (Berkeley) 12/1/1998"; +static char sccsid[] = "@(#)util.c 8.168 (Berkeley) 1/21/1999"; #endif /* not lint */ # include "sendmail.h" @@ -1026,6 +1026,7 @@ sfgets(buf, siz, fp, timeout, during) { register EVENT *ev = NULL; register char *p; + int save_errno; if (fp == NULL) { @@ -1043,7 +1044,6 @@ sfgets(buf, siz, fp, timeout, during) "timeout waiting for input from %.100s during %s", CurHostName ? CurHostName : "local", during); - errno = 0; buf[0] = '\0'; #if XDEBUG checkfd012(during); @@ -1051,6 +1051,7 @@ sfgets(buf, siz, fp, timeout, during) if (TrafficLogFile != NULL) fprintf(TrafficLogFile, "%05d <<< [TIMEOUT]\n", (int) getpid()); + errno = 0; return (NULL); } ev = setevent(timeout, readtimeout, 0); @@ -1058,6 +1059,7 @@ sfgets(buf, siz, fp, timeout, during) /* try to read */ p = NULL; + errno = 0; while (!feof(fp) && !ferror(fp)) { errno = 0; @@ -1066,6 +1068,7 @@ sfgets(buf, siz, fp, timeout, during) break; clearerr(fp); } + save_errno = errno; /* clear the event if it has not sprung */ clrevent(ev); @@ -1077,6 +1080,7 @@ sfgets(buf, siz, fp, timeout, during) buf[0] = '\0'; if (TrafficLogFile != NULL) fprintf(TrafficLogFile, "%05d <<< [EOF]\n", (int) getpid()); + errno = save_errno; return (NULL); } if (TrafficLogFile != NULL) |