aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-28 22:22:45 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-28 22:22:45 +0100
commit8604a82ebbba9a90bc123f91ecbeb2499fef7d2f (patch)
treecd899ce8a89a20d9db0358d74166fa8f7fb555b0 /src
parent1647177908a654f41234e4c457fd17cf4e61d926 (diff)
Add a warnx() wrapper and die/warn with rv 3
Diffstat (limited to 'src')
-rw-r--r--src/grab.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/grab.c b/src/grab.c
index 97c77ef..68968f3 100644
--- a/src/grab.c
+++ b/src/grab.c
@@ -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;
}
}
}