From d72bae839bf4ba527698e0d96c2fab09a524399c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Fri, 31 Jan 1997 15:09:03 -0800
Subject: [PATCH] better error messages added

Rev: src/lex.c:1.15
Rev: src/program.c:1.18
---
 src/lex.c     |  8 ++++++--
 src/program.c | 10 ++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/lex.c b/src/lex.c
index b8ad459bb1..1531d9898f 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 21da12ce80..d5de000342 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
-- 
GitLab