From 97d62a90f5ba28d6f16f40d20a679862394be8c2 Mon Sep 17 00:00:00 2001 From: Tobias Bergkvist Date: Wed, 1 Dec 2021 22:56:18 +0100 Subject: [PATCH] Switch from exit(1) to abort() in assert_success --- pkgs/build-support/setup-hooks/make-binary-wrapper.sh | 2 +- pkgs/test/make-binary-wrapper/combination.c | 2 +- pkgs/test/make-binary-wrapper/env.c | 2 +- pkgs/test/make-binary-wrapper/invalid-env.c | 2 +- pkgs/test/make-binary-wrapper/prefix.c | 2 +- pkgs/test/make-binary-wrapper/suffix.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/build-support/setup-hooks/make-binary-wrapper.sh b/pkgs/build-support/setup-hooks/make-binary-wrapper.sh index 90b9576740b1..29b7c2d845e1 100644 --- a/pkgs/build-support/setup-hooks/make-binary-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-binary-wrapper.sh @@ -138,7 +138,7 @@ makeCWrapper() { [ -z "$uses_concat3" ] || printf '%s\n' "#include " [ -z "$uses_assert" ] || printf '%s\n' "#include " [ -z "$uses_assert_success" ] || printf '%s\n' "#include " - [ -z "$uses_assert_success" ] || printf '\n%s\n' "#define assert_success(e) do { if ((e) < 0) { perror(#e); exit(1); } } while (0)" + [ -z "$uses_assert_success" ] || printf '\n%s\n' "#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)" [ -z "$uses_concat3" ] || printf '\n%s\n' "$(concat3Fn)" [ -z "$uses_prefix" ] || printf '\n%s\n' "$(setEnvPrefixFn)" [ -z "$uses_suffix" ] || printf '\n%s\n' "$(setEnvSuffixFn)" diff --git a/pkgs/test/make-binary-wrapper/combination.c b/pkgs/test/make-binary-wrapper/combination.c index a4082ac4aea0..c476b24394d8 100644 --- a/pkgs/test/make-binary-wrapper/combination.c +++ b/pkgs/test/make-binary-wrapper/combination.c @@ -12,7 +12,7 @@ #include #include -#define assert_success(e) do { if ((e) < 0) { perror(#e); exit(1); } } while (0) +#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0) char *concat3(char *x, char *y, char *z) { int xn = strlen(x); diff --git a/pkgs/test/make-binary-wrapper/env.c b/pkgs/test/make-binary-wrapper/env.c index a1b50b1c3630..fa2e6fc4dd29 100644 --- a/pkgs/test/make-binary-wrapper/env.c +++ b/pkgs/test/make-binary-wrapper/env.c @@ -8,7 +8,7 @@ #include #include -#define assert_success(e) do { if ((e) < 0) { perror(#e); exit(1); } } while (0) +#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0) int main(int argc, char **argv) { putenv("PART1=HELLO"); diff --git a/pkgs/test/make-binary-wrapper/invalid-env.c b/pkgs/test/make-binary-wrapper/invalid-env.c index 02f7cd01a594..bad647bd13a2 100644 --- a/pkgs/test/make-binary-wrapper/invalid-env.c +++ b/pkgs/test/make-binary-wrapper/invalid-env.c @@ -6,7 +6,7 @@ #include #include -#define assert_success(e) do { if ((e) < 0) { perror(#e); exit(1); } } while (0) +#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0) int main(int argc, char **argv) { putenv("==TEST1"); diff --git a/pkgs/test/make-binary-wrapper/prefix.c b/pkgs/test/make-binary-wrapper/prefix.c index 8f7dd9b679c4..8ca0ad94a6d7 100644 --- a/pkgs/test/make-binary-wrapper/prefix.c +++ b/pkgs/test/make-binary-wrapper/prefix.c @@ -8,7 +8,7 @@ #include #include -#define assert_success(e) do { if ((e) < 0) { perror(#e); exit(1); } } while (0) +#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0) char *concat3(char *x, char *y, char *z) { int xn = strlen(x); diff --git a/pkgs/test/make-binary-wrapper/suffix.c b/pkgs/test/make-binary-wrapper/suffix.c index 17160465b41e..31059c86e7a8 100644 --- a/pkgs/test/make-binary-wrapper/suffix.c +++ b/pkgs/test/make-binary-wrapper/suffix.c @@ -8,7 +8,7 @@ #include #include -#define assert_success(e) do { if ((e) < 0) { perror(#e); exit(1); } } while (0) +#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0) char *concat3(char *x, char *y, char *z) { int xn = strlen(x);