Blame SOURCES/bind93-rh490837.patch

b7523e
diff --git a/lib/isc/lex.c b/lib/isc/lex.c
b7523e
index cd44fe3..5b7c539 100644
b7523e
--- a/lib/isc/lex.c
b7523e
+++ b/lib/isc/lex.c
b7523e
@@ -27,6 +27,8 @@
b7523e
 #include <isc/string.h>
b7523e
 #include <isc/util.h>
b7523e
 
b7523e
+#include "../errno2result.h"
b7523e
+
b7523e
 typedef struct inputsource {
b7523e
 	isc_result_t result;
b7523e
 	bool is_file;
b7523e
@@ -422,7 +424,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
b7523e
 #endif /* if defined(HAVE_FLOCKFILE) && defined(HAVE_GETC_UNLOCKED) */
b7523e
 				if (c == EOF) {
b7523e
 					if (ferror(stream)) {
b7523e
-						source->result = ISC_R_IOERROR;
b7523e
+						source->result = isc__errno2result(errno);
b7523e
 						result = source->result;
b7523e
 						goto done;
b7523e
 					}
b7523e
diff --git a/lib/isc/unix/errno2result.c b/lib/isc/unix/errno2result.c
b7523e
index e3e2644..5e58600 100644
b7523e
--- a/lib/isc/unix/errno2result.c
b7523e
+++ b/lib/isc/unix/errno2result.c
b7523e
@@ -37,6 +37,7 @@ isc___errno2result(int posixerrno, bool dolog, const char *file,
b7523e
 	case EINVAL: /* XXX sometimes this is not for files */
b7523e
 	case ENAMETOOLONG:
b7523e
 	case EBADF:
b7523e
+	case EISDIR:
b7523e
 		return (ISC_R_INVALIDFILE);
b7523e
 	case ENOENT:
b7523e
 		return (ISC_R_FILENOTFOUND);