[compiler-rt] 869989d - [sanitizer] Restore trivial posix_spawn init in test
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 1 23:58:27 PDT 2021
Author: Vitaly Buka
Date: 2021-11-01T23:58:18-07:00
New Revision: 869989dd713df68ed0f31b4c80262aed9c5cdc66
URL: https://github.com/llvm/llvm-project/commit/869989dd713df68ed0f31b4c80262aed9c5cdc66
DIFF: https://github.com/llvm/llvm-project/commit/869989dd713df68ed0f31b4c80262aed9c5cdc66.diff
LOG: [sanitizer] Restore trivial posix_spawn init in test
It's still needed on Darwin.
Added:
Modified:
compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c
Removed:
################################################################################
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 6e12abf3ed0d..ea58b92af609 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);
More information about the llvm-commits
mailing list