diff cinst/main.c @ 667:fb69aef056ea

Be more verbose in error logging
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 26 Jun 2014 17:41:53 +0200
parents f595fcbe3e76
children 698b6a9bd75e
line wrap: on
line diff
--- a/cinst/main.c	Thu Jun 26 17:41:31 2014 +0200
+++ b/cinst/main.c	Thu Jun 26 17:41:53 2014 +0200
@@ -90,13 +90,17 @@
 
   f = fopen (file_name, "rb");
   if (f == NULL)
-    return ERR_NO_INSTRUCTIONS;
+    {
+      ERRORPRINTF ("Failed to open file: %s\n", file_name);
+      return ERR_NO_INSTRUCTIONS;
+    }
 
   fseek (f, 0, SEEK_END);
   file_size = ftell (f);
   if (file_size <= 0)
     {
       fclose (f);
+      ERRORPRINTF ("File size error: %s\n", file_name);
       return ERR_NO_INSTRUCTIONS;
     }
 
@@ -105,6 +109,7 @@
   if (file_size + 1 == 0)
     {
       fclose (f);
+      ERRORPRINTF ("File seek error: %s\n", file_name);
       return ERR_INVALID_INSTRUCTIONS;
     }
 

http://wald.intevation.org/projects/trustbridge/