commit 9cb851a3d59e4287837d3a49699e60d0494af6a4
parent ea38f4e05e493b054916de1905b8fcd31f8debb2
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 30 Jul 2012 13:53:52 +0000
more log stuff
Diffstat:
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/main/extractor_logging.h b/src/main/extractor_logging.h
@@ -52,6 +52,25 @@ EXTRACTOR_log_ (const char *file, int line, const char *format, ...);
/**
+ * Log an error message about a failed system/libc call
+ * using an error message based on 'errno'.
+ *
+ * @param syscall name of the syscall that failed
+ */
+#define LOG_STRERROR(syscall) LOG("System call `%s' failed: %s\n", syscall, STRERROR (errno))
+
+
+/**
+ * Log an error message about a failed system/libc call
+ * involving a file using an error message based on 'errno'.
+ *
+ * @param syscall name of the syscall that failed
+ * @param filename name of the file that was involved
+ */
+#define LOG_STRERROR_FILE(syscall,filename) LOG("System call `%s' failed for file `%s': %s\n", syscall, filename, STRERROR (errno))
+
+
+/**
* Abort the program reporting an assertion failure
*
* @param file filename with the failure
@@ -61,6 +80,7 @@ void
EXTRACTOR_abort_ (const char *file,
int line);
+
/**
* Abort program if assertion fails.
*