diff options
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -353,10 +353,24 @@ eval_makefile (const char *filename, int flags) filename = expanded; } - ebuf.fp = fopen (filename, "r"); + ENULLLOOP (ebuf.fp, fopen (filename, "r")); + /* Save the error code so we print the right message later. */ makefile_errno = errno; + /* Check for unrecoverable errors: out of mem or FILE slots. */ + switch (makefile_errno) + { +#ifdef EMFILE + case EMFILE: +#endif +#ifdef ENFILE + case ENFILE: +#endif + case ENOMEM: + fatal (reading_file, "%s", strerror (makefile_errno)); + } + /* If the makefile wasn't found and it's either a makefile from the 'MAKEFILES' variable or an included makefile, search the included makefile search path for this makefile. */ |