diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-01-28 22:22:45 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-28 22:22:45 +0100 |
commit | 8604a82ebbba9a90bc123f91ecbeb2499fef7d2f (patch) | |
tree | cd899ce8a89a20d9db0358d74166fa8f7fb555b0 | |
parent | 1647177908a654f41234e4c457fd17cf4e61d926 (diff) |
Add a warnx() wrapper and die/warn with rv 3
-rw-r--r-- | src/grab.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -34,12 +34,17 @@ #define lengthof(a) (sizeof(a) / sizeof(*(a))) -#define die(...) err(EXIT_FAILURE, __VA_ARGS__) -#define diex(...) errx(EXIT_FAILURE, __VA_ARGS__) +#define die(...) err(3, __VA_ARGS__) +#define diex(...) errx(3, __VA_ARGS__) #define warn(...) \ do { \ warn(__VA_ARGS__); \ - rv = EXIT_FAILURE; \ + rv = 3; \ + } while (0) +#define warnx(...) \ + do { \ + warnx(__VA_ARGS__); \ + rv = 3; \ } while (0) #define streq(a, b) (!strcmp(a, b)) @@ -636,7 +641,6 @@ putm(struct sv sv, struct matches *ms, const char *filename) break; default: warnx("invalid color value -- '%s'", val); - rv = EXIT_FAILURE; } } } |