[sanitizer] Restore trivial posix_spawn init in test
authorVitaly Buka <vitalybuka@google.com>
Tue, 2 Nov 2021 06:57:13 +0000 (23:57 -0700)
committerVitaly Buka <vitalybuka@google.com>
Tue, 2 Nov 2021 06:58:18 +0000 (23:58 -0700)
It's still needed on Darwin.

compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c

index 6e12abf..ea58b92 100644 (file)
@@ -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);