2016-09-12  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* test/nofile.ok: Added "(ENOENT)" to error message.


2016-09-10  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* pc/config.h (HAVE_SETLOCALE, HAVE_SNPRINTF, HAVE_STDINT_H,
	HAVE_STDLIB_H, PRINTF_HAS_F_FORMAT): Define to 1 for DJGPP.
	(DJGPP_MINOR > 3): Do no longer typedef uint32_t and int32_t.
	(DJGPP_MINOR > 3, HAVE_STRCOLL): Define to 1 for DJGPP.

	* pc/config.sed (HAVE_SETLOCALE, HAVE_SNPRINTF, HAVE_STDINT_H,
	HAVE_STDLIB_H, PRINTF_HAS_F_FORMAT): Define to 1 for DJGPP.
	(DJGPP_MINOR > 3): Do no longer typedef uint32_t and int32_t.
	(DJGPP_MINOR > 3, HAVE_STRCOLL): Define to 1 for DJGPP.


2016-09-08  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* pc/config.h (HAVE_LOCALE_H): Define to 1 for DJGPP.

	* pc/config.sed (HAVE_LOCALE_H): Define to 1 for DJGPP.


2016-08-30  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* mbsupport.h [DJGPP]: Prototypes for btowc and putwc added.

	* pc/config.h (HAVE_WCHAR_H, HAVE_WCTYPE_H, HAVE_WCTYPE_T and
	HAVE_WINT_T): Define to 1 for DJGPP.

	* pc/config.sed (HAVE_WCHAR_H, HAVE_WCTYPE_H, HAVE_WCTYPE_T and
	HAVE_WINT_T): Define to 1 for DJGPP.

	* pc/gawkmisc.pc [__DJGPP__, __DJGPP_MINOR__]: Use unsetenv only if
	compiling with DJGPP 2.03 or less.
	Include io.h to provide setmode prototype.
	putwc implemented.

	* pc/Makefile: Add definitions for pkgextensiondir, DEFLIBPATH and
	LOCALEDIR.  For all use $(prefix) to define their path.
	Use /dev/env/DJDIR as $(prefix) value for DJGPP.
	For DJGPP add "DXE" as definition for SHLIBEXT.
	Change dependecy popen.h and socket.h to pc/popen.h and pc/socket.h.

	* pc/Makefile.tst (manyfiles): Limit the number of simultaneously
	opened files to 250.
	Set DATE to /dev/env/DJDIR/date.
	Remove DJGPP specific warnings about test failure for certain checks.

	* README_d/README.pc: Explain that only config.h and Makefile need
	to be copied to srcdir.

	* test/beginfile1.ok: Added "(ENOENT)" and "(EISDIR)" to error message.

	* test/getlndir.ok: Added "(EISDIR)" to error message.

	* test/space.ok: Added "(ENOENT)" to error message.







diff -aprNU5 gawk-4.1.4.orig/mbsupport.h gawk-4.1.4/mbsupport.h
--- gawk-4.1.4.orig/mbsupport.h	2016-05-30 20:10:06 +0200
+++ gawk-4.1.4/mbsupport.h	2016-09-10 14:48:32 +0200
@@ -47,6 +47,10 @@
 #define mbstate_t	int
 
 extern wctype_t wctype(const char *name);
 extern int iswctype(wint_t wc, wctype_t desc);
 extern int wcscoll(const wchar_t *ws1, const wchar_t *ws2);
+
+wint_t btowc (int c);
+wint_t putwc(wchar_t wc, FILE *stream);
+
 #endif
diff -aprNU5 gawk-4.1.4.orig/pc/config.h gawk-4.1.4/pc/config.h
--- gawk-4.1.4.orig/pc/config.h	2016-08-25 05:40:54 +0200
+++ gawk-4.1.4/pc/config.h	2016-09-10 16:35:02 +0200
@@ -123,11 +123,11 @@
 
 /* Define to 1 if you have the <limits.h> header file. */
 #define HAVE_LIMITS_H 1
 
 /* Define to 1 if you have the <locale.h> header file. */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(__DJGPP__)
 #define HAVE_LOCALE_H 1
 #endif
 
 /* Define to 1 if the system has the type 'long long int'. */
 #undef HAVE_LONG_LONG_INT
@@ -192,19 +192,19 @@
 #if defined(__MINGW32__) || defined(__DJGPP__)
 #define HAVE_SETENV 1
 #endif
 
 /* Define to 1 if you have the `setlocale' function. */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(__DJGPP__)
 #define HAVE_SETLOCALE 1
 #endif
 
 /* Define to 1 if you have the `setsid' function. */
 #undef HAVE_SETSID
 
 /* Define to 1 if you have the `snprintf' function. */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(__DJGPP__)
 #define HAVE_SNPRINTF 1
 #endif
 
 /* newer systems define this type here */
 #ifdef __MINGW32__
@@ -226,16 +226,16 @@
 #ifdef __GNUC__
 #define HAVE_STDDEF_H 1
 #endif
 
 /* Define to 1 if you have the <stdint.h> header file. */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(__DJGPP__)
 #define HAVE_STDINT_H 1
 #endif
 
 /* Define to 1 if you have the <stdlib.h> header file. */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(__DJGPP__)
 #define HAVE_STDLIB_H 1
 #endif
 
 /* Define to 1 if you have the `strcasecmp' function. */
 #undef HAVE_STRCASECMP
@@ -377,11 +377,11 @@
 #if defined(__DJGPP__) || defined(__MINGW32__)
 #define HAVE_USLEEP 1
 #endif
 
 /* Define to 1 if you have the <wchar.h> header file. */
-#ifdef __MINGW32__
+#if defined(__DJGPP__) || defined(__MINGW32__)
 #define HAVE_WCHAR_H 1
 #endif
 
 /* Define to 1 if you have the `wcrtomb' function. */
 #ifdef __MINGW32__
@@ -397,21 +397,21 @@
 #ifdef __MINGW32__
 #define HAVE_WCTYPE 1
 #endif
 
 /* Define to 1 if you have the <wctype.h> header file. */
-#ifdef __MINGW32__
+#if defined(__DJGPP__) || defined(__MINGW32__)
 #define HAVE_WCTYPE_H 1
 #endif
 
 /* systems should define this type here */
-#ifdef __MINGW32__
+#if defined(__DJGPP__) || defined(__MINGW32__)
 #define HAVE_WCTYPE_T 1
 #endif
 
 /* systems should define this type here */
-#ifdef __MINGW32__
+#if defined(__DJGPP__) || defined(__MINGW32__)
 #define HAVE_WINT_T 1
 #endif
 
 /* Define to 1 if the system has the type `_Bool'. */
 #undef HAVE__BOOL
@@ -620,16 +620,21 @@
 
 #ifndef __DJGPP__
 #define HAVE_POPEN_H 1
 #endif
 
-#if defined(__DJGPP__)
+#if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ < 4)
 typedef unsigned int uint32_t;
 typedef int int32_t;
 #define INT32_MAX INT_MAX
 #define INT32_MIN INT_MIN
 #endif
 
+#if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ > 4)
+#undef HAVE_STRCOLL
+#define HAVE_STRCOLL 1
+#endif
+
 #if defined(__EMX__)
 #define strcasecmp stricmp
 #define strncasecmp strnicmp
 #endif
diff -aprNU5 gawk-4.1.4.orig/pc/config.sed gawk-4.1.4/pc/config.sed
--- gawk-4.1.4.orig/pc/config.sed	2016-05-30 20:10:06 +0200
+++ gawk-4.1.4/pc/config.sed	2016-09-10 16:35:00 +0200
@@ -81,11 +81,11 @@ s/^#undef HAVE_FMOD *$/#define HAVE_FMOD
 s/^#undef HAVE_LIBM *$/#define HAVE_LIBM 1/
 /^#undef HAVE_LIBREADLINE *$/c\
 /* #undef HAVE_LIBREADLINE */
 s/^#undef HAVE_LIMITS_H *$/#define HAVE_LIMITS_H 1/
 /^#undef HAVE_LOCALE_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
 #define HAVE_LOCALE_H 1\
 #endif
 /^#undef HAVE_LONG_LONG *$/c\
 #ifdef __MINGW32__\
 #define HAVE_LONG_LONG 1\
@@ -115,15 +115,15 @@ s/^#undef HAVE_MKTIME *$/#define HAVE_MK
 /^#undef HAVE_SETENV *$/c\
 #if defined(__MINGW32__) || defined(__DJGPP__)\
 #define HAVE_SETENV 1\
 #endif
 /^#undef HAVE_SETLOCALE *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
 #define HAVE_SETLOCALE 1\
 #endif
 /^#undef HAVE_SNPRINTF *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
 #define HAVE_SNPRINTF 1\
 #endif
 /^#undef HAVE_SOCKADDR_STORAGE *$/c\
 #ifdef __MINGW32__\
 #define HAVE_SOCKADDR_STORAGE 1\
@@ -136,14 +136,14 @@ s/^#undef HAVE_STDARG_H *$/#define HAVE_
 /^#undef HAVE_STDDEF_H *$/c\
 #ifdef __GNUC__\
 #define HAVE_STDDEF_H 1\
 #endif
 /^#undef HAVE_STDINT_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
 #define HAVE_STDINT_H 1\
 #endif
-/^#undef HAVE_STDLIB_H *$/c\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
 #ifdef __MINGW32__\
 #define HAVE_STDLIB_H 1\
 #endif
 s/^#undef HAVE_STRCHR *$/#define HAVE_STRCHR 1/
 s/^#undef HAVE_STRERROR *$/#define HAVE_STRERROR 1/
@@ -210,11 +210,11 @@ s/^#undef HAVE_UNSIGNED_LONG_LONG *$/#de
 #if defined(__DJGPP__) || defined(__MINGW32__)\
 #define HAVE_USLEEP 1\
 #endif
 s/^#undef HAVE_VPRINTF *$/#define HAVE_VPRINTF 1/
 /^#undef HAVE_WCHAR_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
 #define HAVE_WCHAR_H 1\
 #endif
 /^#undef HAVE_WCRTOMB *$/c\
 #ifdef __MINGW32__\
 #define HAVE_WCRTOMB 1\
@@ -226,19 +226,19 @@ s/^#undef HAVE_VPRINTF *$/#define HAVE_V
 /^#undef HAVE_WCTYPE *$/c\
 #ifdef __MINGW32__\
 #define HAVE_WCTYPE 1\
 #endif
 /^#undef HAVE_WCTYPE_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
 #define HAVE_WCTYPE_H 1\
 #endif
 /^#undef HAVE_WCTYPE_T *$/c\
-#ifdef __MINGW32__\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
 #define HAVE_WCTYPE_T 1\
 #endif
 /^#undef HAVE_WINT_T *$/c\
-#ifdef __MINGW32__\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
 #define HAVE_WINT_T 1\
 #endif
 s/^#undef PROTOTYPES *$/#define PROTOTYPES 1/
 s/^#undef RETSIGTYPE *$/#define RETSIGTYPE void/
 /^#.*RETSIGTYPE /a\
@@ -287,16 +287,21 @@ $a\
 \
 #ifndef __DJGPP__\
 #define HAVE_POPEN_H 1\
 #endif\
 \
-#if defined(__DJGPP__)\
+#if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ < 4)\
 typedef unsigned int uint32_t;\
 typedef int int32_t;\
 #define INT32_MAX INT_MAX\
 #define INT32_MIN INT_MIN\
 #endif\
 \
+#if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ > 4)\
+#undef HAVE_STRCOLL\
+#define HAVE_STRCOLL 1\
+#endif\
+\
 #if defined(__EMX__)\
 #define strcasecmp stricmp\
 #define strncasecmp strnicmp\
 #endif
diff -aprNU5 gawk-4.1.4.orig/pc/gawkmisc.pc gawk-4.1.4/pc/gawkmisc.pc
--- gawk-4.1.4.orig/pc/gawkmisc.pc	2016-05-30 20:10:06 +0200
+++ gawk-4.1.4/pc/gawkmisc.pc	2016-09-10 14:48:32 +0200
@@ -299,10 +299,11 @@ os_is_setuid()
 
 /* os_setbinmode --- set binary mode on file */
 
 #ifdef __DJGPP__
 #include <sys/exceptn.h>
+#include <io.h>
 #endif
 static int orig_tty_mode = -1;
 
 int
 os_setbinmode(fd, mode)
@@ -916,23 +917,32 @@ init_sockets(void)
 
 #endif	/* __DJGPP__ || __MINGW32__ */
 
 #ifdef __DJGPP__
 
+# if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4 
 int
 unsetenv (const char *name)
 {
   if (!name || !*name || strchr (name, '=') != NULL)
     return -1;
 
   return putenv (name);
 }
+#endif
 
 /* This is needed to defeat too-clever GCC warnings in dfa.c about
    comparison being always false due to limited range of data type.  */
 wint_t
 btowc (int c)
 {
   return c;
 }
 
+wint_t
+putwc(wchar_t wc, FILE *stream)
+{
+  return MB_CUR_MAX == 1 && wc > 0 && wc <= UCHAR_MAX
+         && putc((unsigned char)wc, stream) != EOF ? (wint_t)wc : WEOF;
+}
+
 #endif /* __DJGPP__ */
diff -aprNU5 gawk-4.1.4.orig/pc/Makefile gawk-4.1.4/pc/Makefile
--- gawk-4.1.4.orig/pc/Makefile	2016-05-30 20:10:06 +0200
+++ gawk-4.1.4/pc/Makefile	2016-09-10 14:48:32 +0200
@@ -79,11 +79,14 @@ MAK = $(MAKE) $(MAKEFILE)
 #prefix =
 prefix = c:/gnu
 pkgdatadir = $(prefix)/lib/awk
 pkgextensiondir = $(prefix)/lib/gawk
 DEFLIBPATH = "\"$(pkgextensiondir)\""
+LOCALEDIR="\"$(prefix)/share/locale\""
 SHLIBEXT = "\"dll\""
+infodir = $(prefix)/info
+mandir = $(prefix)/share/man
 #
 # Define the install method. Method 1 is Unix-like (and requires cat
 # and cp); method 2 uses gawk and batch files.
 install = 1
 #------------------------------------------------------------------------
@@ -98,12 +101,18 @@ DO_BIND= $($(BIND))
 #========================================================================
 #========================== DJGPP =======================================
 #========================================================================
 
 ifneq ($(DJGPP),)
-prefix = $(DJDIR)
+prefix = /dev/env/DJDIR
 pkgdatadir = $(prefix)/share/awk
+pkgextensiondir = $(prefix)/lib/gawk
+DEFLIBPATH = "\"$(pkgextensiondir)\""
+LOCALEDIR="\"$(prefix)/share/locale\""
+SHLIBEXT = "\"dxe\""
+infodir = $(prefix)/share/info
+mandir = $(prefix)/share/man
 endif
 LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2)
 BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk
 
 djgpp:
@@ -196,11 +205,11 @@ mingw32-readline-mpfr:
 # Define BIND for BINDless compiles, otherwise $($(BIND)) may break.
 BIND = EMPTY
 PBIND = EMPTY
 EMPTY=
 
-CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT)
+CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT) -DLOCALEDIR=$(LOCALEDIR)
 
 # object files
 AWKOBJS1  = array$O builtin$O eval$O field$O floatcomp$O gawkmisc$O io$O main$O
 AWKOBJS2  = ext$O msg$O node$O profile$O re$O replace$O version$O symbol$O
 AWKOBJS3  = debug$O cint_array$O int_array$O mpfr$O str_array$O command$O
@@ -242,30 +251,46 @@ $(RSPFILE) : $(GAWKOBJS)
 #    included by awk.h.
 # 2. custom.h is not mentioned because pc ports don't use it.
 $(ALLOBJS) $(LIBOBJS): \
   awk.h regex.h config.h gettext.h mbsupport.h protos.h dfa.h getopt.h nonposix.h
 
+ifneq ($(DJGPP),)
+builtin$O:	floatmagic.h random.h pc/popen.h
+
+io$O:		pc/popen.h pc/socket.h pc/in.h
+
+gawkmisc$O:	pc/gawkmisc.pc pc/socket.h
+else
 builtin$O:	floatmagic.h random.h popen.h
 
+io$O:		popen.h socket.h in.h
+
+gawkmisc$O:	pc/gawkmisc.pc socket.h
+endif
+
 random$O:	random.h
 
 node$O:		floatmagic.h
 
 command$O debug$O:	cmd.h
 
 dfa$O:		xalloc.h
 
-gawkmisc$O:	pc/gawkmisc.pc socket.h
-
 getopt$O getopt1$O :	getopt_int.h
 
-io$O:		popen.h socket.h in.h
-
 regex$O:	regcomp.c regexec.c regex_internal.h
 
 eval$O:		interpret.h
 
+ifneq ($(DJGPP),)
+getid$O:	pc/getid.c
+	$(CC) -c $(CFLAGS) pc/getid.c
+
+popen$O:	pc/popen.c
+	$(CC) -c $(CFLAGS) pc/popen.c
+endif
+
 # A bug in ndmake requires the following rule
 awkgram$O: awk.h awkgram.c
 	$(CC) -c $(CFLAGS) awkgram.c
 
 awkgram.c:	awkgram.y
@@ -286,12 +311,12 @@ install1:
 	-mkdir "$(prefix)"
 	-mkdir "$(prefix)/bin"
 	-mkdir "$(prefix)/share"
 	-mkdir "$(prefix)/share/man"
 	-mkdir "$(pkgdatadir)" "$(prefix)/share/man/man1" "$(prefix)/share/info"
-	cp *awk.exe igawk.bat igawk.cmd pc/awklib/igawk $(prefix)/bin
 	cp gawk.exe $(prefix)/bin/awk.exe
+	cp *awk.exe igawk.bat igawk.cmd pc/awklib/igawk $(prefix)/bin
 	cp awklib/eg/lib/* pc/awklib/igawk.awk $(pkgdatadir)
 	cp doc/*.1 $(prefix)/share/man/man1
 	cp doc/*.info $(prefix)/share/info
 
 # install2 is equivalent to install1, but doesn't require cp, sed, etc.
diff -aprNU5 gawk-4.1.4.orig/pc/Makefile.tst gawk-4.1.4/pc/Makefile.tst
--- gawk-4.1.4.orig/pc/Makefile.tst	2016-08-14 18:12:40 +0200
+++ gawk-4.1.4/pc/Makefile.tst	2016-09-10 14:48:32 +0200
@@ -95,11 +95,11 @@ PGAWK = ../gawk.exe -p
 CMP = diff -u
 #CMP = gcmp
 
 # cmp replacement program for PC where the error messages aren't
 # exactly the same.  Should run even on old awk.
-TESTOUTCMP = $(AWK) -f ../testoutcmp.awk
+TESTOUTCMP = $(AWK) -f ../pc/testoutcmp.awk
 
 # Set your "cp," "mv," and "mkdir" commands here.  Note: DOS's copy must take
 # forward slashes.
 CP = cp
 #CP = : && command -c copy
@@ -113,15 +113,22 @@ MV = cmd.exe /c ren
 #MKDIR = : && command -c mkdir
 MKDIR  = command.com /c mkdir
 
 # Set your unix-style date function here
 #DATE = date
-DATE = gdate
+DATE = /dev/env/DJDIR/bin/date
 
 # MS-DOS and OS/2 use ; as a PATH delimiter
 PATH_SEPARATOR = ;
 
+# MS-DOS has a limit of open files.
+ifneq ($(DJDIR),)
+NUMBER_OF_FILES = 250
+else
+NUMBER_OF_FILES = 1030
+endif
+
 # Non-default GREP_OPTIONS might fail the badargs test
 export GREP_OPTIONS=
 
 # ============================================================================
 # You shouldn't need to modify anything below this line.
@@ -415,11 +422,11 @@ regtest::
 
 manyfiles::
 	@echo manyfiles
 	@rm -rf junk
 	@mkdir junk
-	@$(AWK) 'BEGIN { for (i = 1; i <= 1030; i++) print i, i}' >_$@
+	@$(AWK) 'BEGIN { for (i = 1; i <= $(NUMBER_OF_FILES); i++) print i, i}' >_$@
 	@$(AWK) -f "$(srcdir)"/manyfiles.awk _$@ _$@
 	@wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed "s/  *//g" > _$@
 	@rm -rf junk
 	@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
@@ -2450,11 +2457,10 @@ gensub2:
 	@AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
 	@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
 getlndir:
 	@echo $@
-	@echo Expect getlndir to fail with DJGPP.
 	@AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
 	@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
 gnuops2:
 	@echo $@
diff -aprNU5 gawk-4.1.4.orig/README_d/README.pc gawk-4.1.4/README_d/README.pc
--- gawk-4.1.4.orig/README_d/README.pc	2015-04-05 08:13:46 +0200
+++ gawk-4.1.4/README_d/README.pc	2016-09-10 14:48:32 +0200
@@ -23,11 +23,11 @@ The `configure' step takes a long time,
 ************************************************************************
 
 Building gawk
 -------------
 
-Copy the files in the `pc' directory (EXCEPT for `ChangeLog') to the
+Copy the files config.h and Makefile in the `pc' directory to the
 directory with the rest of the gawk sources.  (The subdirectories of 
 `pc' need not be copied.)  The Makefile contains a configuration 
 section with comments, and may need to be edited in order to work
 with your make utility.  If you are building with MinGW, copy the
 file Makefile.ext to extension/Makefile.
diff -aprNU5 gawk-4.1.4.orig/test/beginfile1.ok gawk-4.1.4/test/beginfile1.ok
--- gawk-4.1.4.orig/test/beginfile1.ok	2014-01-20 19:52:56 +0100
+++ gawk-4.1.4/test/beginfile1.ok	2016-09-10 14:48:32 +0200
@@ -2,13 +2,13 @@ In BEGINFILE:
 	FILENAME = beginfile1.awk, FNR = 0, ERRNO = ""
 processing beginfile1.awk
 In ENDFILE:
 	FILENAME = beginfile1.awk, FNR = 2, ERRNO = ""
 In BEGINFILE:
-	FILENAME = ., FNR = 0, ERRNO = "Is a directory"
+	FILENAME = ., FNR = 0, ERRNO = "Is a directory (EISDIR)"
 In BEGINFILE:
-	FILENAME = file, FNR = 0, ERRNO = "No such file or directory"
+	FILENAME = file, FNR = 0, ERRNO = "No such file or directory (ENOENT)"
 In BEGINFILE:
-	FILENAME = Makefile, FNR = 0, ERRNO = ""
+	FILENAME = Makefile, FNR = 0, ERRNO = "No such file or directory (ENOENT)"
 processing Makefile
 In ENDFILE:
 	FILENAME = Makefile, FNR = 2, ERRNO = ""
diff -aprNU5 gawk-4.1.4.orig/test/getlndir.ok gawk-4.1.4/test/getlndir.ok
--- gawk-4.1.4.orig/test/getlndir.ok	2012-05-03 18:13:52 +0200
+++ gawk-4.1.4/test/getlndir.ok	2016-09-10 14:48:32 +0200
@@ -1 +1 @@
-4, -1, Is a directory
+4, -1, Is a directory (EISDIR)
diff -aprNU5 gawk-4.1.4.orig/test/nofile.ok gawk-4.1.4/test/nofile.ok
--- gawk-4.1.4.orig/test/nofile.ok	2014-01-20 19:52:56 +0100
+++ gawk-4.1.4/test/nofile.ok	2016-09-12 22:32:10 +0200
@@ -1,2 +1,2 @@
-gawk: fatal: cannot open file `no/such/file' for reading (No such file or directory)
+gawk: fatal: cannot open file `no/such/file' for reading (No such file or directory (ENOENT))
 EXIT CODE: 2
diff -aprNU5 gawk-4.1.4.orig/test/space.ok gawk-4.1.4/test/space.ok
--- gawk-4.1.4.orig/test/space.ok	2012-05-03 18:13:52 +0200
+++ gawk-4.1.4/test/space.ok	2016-09-10 14:48:34 +0200
@@ -1,2 +1,2 @@
-gawk: fatal: can't open source file ` ' for reading (No such file or directory)
+gawk: fatal: can't open source file ` ' for reading (No such file or directory (ENOENT))
 EXIT CODE: 2
