[PATCH 4 of 6] Be more verbose in error logging
Wald Commits
scm-commit at wald.intevation.org
Thu Jun 26 17:43:20 CEST 2014
# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1403797313 -7200
# Node ID fb69aef056ea2b8616f9610d570ad782123b6e3f
# Parent d905758aa3a634b434d72005978ea1fe3d77fe37
Be more verbose in error logging
diff -r d905758aa3a6 -r fb69aef056ea cinst/main.c
--- 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;
}
More information about the Trustbridge-commits
mailing list