Mercurial > trustbridge
changeset 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 | d905758aa3a6 |
children | ef6d3dc9e930 |
files | cinst/main.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
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; }