From: Vitaly Buka Date: Tue, 2 Nov 2021 06:57:13 +0000 (-0700) Subject: [sanitizer] Restore trivial posix_spawn init in test X-Git-Tag: upstream/15.0.7~26992 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=869989dd713df68ed0f31b4c80262aed9c5cdc66;p=platform%2Fupstream%2Fllvm.git [sanitizer] Restore trivial posix_spawn init in test It's still needed on Darwin. --- 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);