diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-08-10 21:48:17 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-08-10 21:48:17 +0200 |
commit | 4ab76a51127b549a96a8a5119f60af432b94684a (patch) | |
tree | e3be4d4a4ea64fb0a091931cce2667cdb79e69d0 /src/global.h | |
parent | f4b0e9b6f3c9ac67c92f6144e671904986a9d873 (diff) | |
download | 0xFFFF-4ab76a51127b549a96a8a5119f60af432b94684a.tar.bz2 |
global: Fix ERROR_INFO_STR
Diffstat (limited to 'src/global.h')
-rw-r--r-- | src/global.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/global.h b/src/global.h index f2cab07..e1f0365 100644 --- a/src/global.h +++ b/src/global.h @@ -12,7 +12,7 @@ extern int verbose; #define VERBOSE(...) do { if ( verbose ) { fprintf(stderr, __VA_ARGS__); } } while (0) #define WARNING(...) do { fprintf(stderr, "Warning: "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); } while (0) -#define ERROR_INFO_STR(str, ...) do { if ( str[0] ) fprintf(stderr, "Error: %s: ", str); else fprintf(stderr, "Error: "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); } while (0) +#define ERROR_INFO_STR(str, ...) do { if ( str[0] ) fprintf(stderr, "Error: %s: ", str); else fprintf(stderr, "Error: "); fprintf(stderr, __VA_ARGS__); if ( errno ) fprintf(stderr, ": %s\n", strerror(errno)); else fprintf(stderr, "\n"); } while (0) #define ERROR_STR(str, ...) do { errno = 0; ERROR_INFO_STR(str, __VA_ARGS__); } while (0) #define ERROR_INFO(...) do { ERROR_INFO_STR("", __VA_ARGS__); } while (0) #define ERROR(...) do { ERROR_STR("", __VA_ARGS__); } while (0) |