bind9-next/bind93-rh490837.patch
Petr Menšík 990ae7c669 Import some data from bind branch bind9-dev
Imports commit  7e1db866748aef3c07657e0761b19aec6de9bf6f
2023-01-27 18:24:45 +01:00

35 lines
1.0 KiB
Diff

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