logging: fix die(), again
authorMarko Kreen <markokr@gmail.com>
Tue, 12 Oct 2010 11:02:46 +0000 (14:02 +0300)
committerMarko Kreen <markokr@gmail.com>
Tue, 12 Oct 2010 11:02:46 +0000 (14:02 +0300)
test/compile.c
usual/logging.h

index 5b1b3b90497a1fe831d7f9c50b8396be5a54a40d..6a6140896069e5b5645bb9c13d3e46ecc118406d 100644 (file)
@@ -51,6 +51,7 @@ int main(void)
        md5_reset(&md5);
        strlcpy(buf, "foo", sizeof(buf));
        printf("xmalloc: %p\n", xmalloc(128));
+       if (0) die("0");
        return 0;
 }
 
index 1a36b3342b8f701fa7718c5081861077985e8afb..c6ea4ac07d976f40c940293ce0372b4631e212c2 100644 (file)
@@ -153,7 +153,7 @@ void log_fatal(const char *file, int line, const char *func, bool show_perror,
 
 /** Less verbose fatal() */
 #define die(fmt, args...) do { LOG_CONTEXT_DEF; \
-       log_generic(LG_FATAL, LOG_CONTEXT, ## args); \
+       log_generic(LG_FATAL, LOG_CONTEXT, fmt, ## args); \
        exit(1); } while (0)
 
 /**