]> git.saurik.com Git - apple/xnu.git/blobdiff - tests/sigcont_return.c
xnu-4903.270.47.tar.gz
[apple/xnu.git] / tests / sigcont_return.c
index 606caa9109b1e3969ca11370eb51bf2bf70d19b6..5e9258923dfbea77576f4855cdf030ead50d63ec 100644 (file)
@@ -8,21 +8,22 @@
 
 T_DECL(sigcontreturn, "checks that a call to waitid() for a child that is stopped and then continued returns correctly")
 {
-        pid_t           pid;
-        siginfo_t       siginfo;
-        pid = fork();
-        T_QUIET; T_ASSERT_NE_INT(pid, -1, "fork() failed!");
+       pid_t           pid;
+       siginfo_t       siginfo;
+       pid = fork();
+       T_QUIET; T_ASSERT_NE_INT(pid, -1, "fork() failed!");
 
-        if (pid == 0) {
-                while(1){}
-        }
+       if (pid == 0) {
+               while (1) {
+               }
+       }
 
-        kill(pid, SIGSTOP);
-        kill(pid, SIGCONT);
-        sleep(1);
+       kill(pid, SIGSTOP);
+       kill(pid, SIGCONT);
+       sleep(1);
 
-        T_QUIET; T_ASSERT_POSIX_SUCCESS(waitid(P_PID, pid, &siginfo, WCONTINUED), "Calling waitid() failed for pid %d", pid);
+       T_QUIET; T_ASSERT_POSIX_SUCCESS(waitid(P_PID, pid, &siginfo, WCONTINUED), "Calling waitid() failed for pid %d", pid);
 
-        T_ASSERT_EQ_INT(siginfo.si_status, SIGCONT, "A call to waitid() for stopped and continued child returns 0x%x, expected SIGCONT (0x%x)", siginfo.si_status, SIGCONT );
-        kill(pid, SIGKILL);
+       T_ASSERT_EQ_INT(siginfo.si_status, SIGCONT, "A call to waitid() for stopped and continued child returns 0x%x, expected SIGCONT (0x%x)", siginfo.si_status, SIGCONT );
+       kill(pid, SIGKILL);
 }