diff options
| author | Brent Cook <bcook@openbsd.org> | 2015-07-22 09:00:38 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2015-07-22 09:00:38 -0500 |
| commit | a9b16c2d66de5e4cda13c51b9a0c50964850a87c (patch) | |
| tree | 08c4d8dbae8d4402930a5bb7b28d424be506d78e /include | |
| parent | a9122f74e0b965c7ecb5e8ceb8e3dfb682e14336 (diff) | |
| download | portable-a9b16c2d66de5e4cda13c51b9a0c50964850a87c.tar.gz portable-a9b16c2d66de5e4cda13c51b9a0c50964850a87c.tar.bz2 portable-a9b16c2d66de5e4cda13c51b9a0c50964850a87c.zip | |
correct fallback err.h macro behavior
Diffstat (limited to 'include')
| -rw-r--r-- | include/compat/err.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/compat/err.h b/include/compat/err.h index af68a26..eaf7ccc 100644 --- a/include/compat/err.h +++ b/include/compat/err.h | |||
| @@ -17,16 +17,16 @@ | |||
| 17 | #include <string.h> | 17 | #include <string.h> |
| 18 | 18 | ||
| 19 | #define err(exitcode, format, ...) \ | 19 | #define err(exitcode, format, ...) \ |
| 20 | errx(exitcode, format ": %s", __VA_ARGS__, strerror(errno)) | 20 | errx(exitcode, format ": %s", ## __VA_ARGS__, strerror(errno)) |
| 21 | 21 | ||
| 22 | #define errx(exitcode, format, ...) \ | 22 | #define errx(exitcode, format, ...) \ |
| 23 | do { warnx(format, __VA_ARGS__); exit(exitcode); } while (0) | 23 | do { warnx(format, ## __VA_ARGS__); exit(exitcode); } while (0) |
| 24 | 24 | ||
| 25 | #define warn(format, ...) \ | 25 | #define warn(format, ...) \ |
| 26 | warnx(format ": %s", __VA_ARGS__, strerror(errno)) | 26 | warnx(format ": %s", ## __VA_ARGS__, strerror(errno)) |
| 27 | 27 | ||
| 28 | #define warnx(format, ...) \ | 28 | #define warnx(format, ...) \ |
| 29 | fprintf(stderr, format "\n", __VA_ARGS__) | 29 | fprintf(stderr, format "\n", ## __VA_ARGS__) |
| 30 | 30 | ||
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
