diff --git a/src/lex.c b/src/lex.c index b8ad459bb1a1c72e1ffb3bdcaa633b3580f4f6a2..1531d9898f2c762053cb04d7d4d315b142495e6e 100644 --- a/src/lex.c +++ b/src/lex.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: lex.c,v 1.14 1997/01/30 03:51:34 hubbe Exp $"); +RCSID("$Id: lex.c,v 1.15 1997/01/31 23:09:02 hubbe Exp $"); #include "language.h" #include "array.h" #include "lex.h" @@ -1032,7 +1032,11 @@ static void handle_include(char *name, int local_include) { if(errno == EINTR) goto retry; - my_yyerror("Couldn't open file to include '%s'.",sp[-1].u.string->str); +#ifdef HAVE_STRERROR + my_yyerror("Couldn't open file to include '%s'. (%s)",sp[-1].u.string->str,strerror(errno)); +#else + my_yyerror("Couldn't open file to include '%s'. (ERRNO=%d)",sp[-1].u.string->str,errno); +#endif return; } diff --git a/src/program.c b/src/program.c index 21da12ce803ce5c2f3e413b7fd6b8447488c4704..d5de00034242efa4b42e0b59bbf6b108d5bf37fb 100644 --- a/src/program.c +++ b/src/program.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: program.c,v 1.17 1997/01/29 01:09:19 hubbe Exp $"); +RCSID("$Id: program.c,v 1.18 1997/01/31 23:09:03 hubbe Exp $"); #include "program.h" #include "object.h" #include "dynamic_buffer.h" @@ -1441,7 +1441,13 @@ struct program *compile_file(struct pike_string *file_name) fd=open(file_name->str,O_RDONLY); if(fd >= 0) break; if(errno != EINTR) - error("Couldn't open file '%s'.\n",file_name->str); + { +#ifdef HAVE_STRERROR + error("Couldn't open file '%s'. (%s)\n",file_name->str,strerror(errno)); +#else + error("Couldn't open file '%s'. (ERRNO=%d)\n",file_name->str,errno); +#endif + } } #define FILE_STATE