From 869989dd713df68ed0f31b4c80262aed9c5cdc66 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 1 Nov 2021 23:57:13 -0700 Subject: [PATCH] [sanitizer] Restore trivial posix_spawn init in test It's still needed on Darwin. --- .../test/sanitizer_common/TestCases/Posix/posix_spawn.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c index 6e12abf..ea58b92 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c @@ -16,15 +16,8 @@ int main(int argc, char **argv) { return 0; } - int s; - - posix_spawnattr_t attr; - s = posix_spawnattr_init(&attr); - assert(!s); - - posix_spawn_file_actions_t file_actions; - s = posix_spawn_file_actions_init(&file_actions); - assert(!s); + posix_spawnattr_t attr = {0}; + posix_spawn_file_actions_t file_actions = {0}; char *const args[] = { argv[0], "2", "3", "4", "2", "3", "4", "2", "3", "4", @@ -36,7 +29,7 @@ int main(int argc, char **argv) { }; pid_t pid; - s = posix_spawn(&pid, argv[0], &file_actions, &attr, args, env); + int s = posix_spawn(&pid, argv[0], &file_actions, &attr, args, env); assert(!s); waitpid(pid, &s, WUNTRACED | WCONTINUED); -- 2.7.4