if (!(pid_got == -1 && errno == ECHILD))
{
assert (pid_got == pid);
- assert ((WIFSIGNALED (status) && WTERMSIG (status) == SIGKILL)
+ assert ((WIFSIGNALED (status) && (WTERMSIG (status) == SIGKILL
+ || WTERMSIG (status) == SIGUSR2))
|| (WIFEXITED (status) && WEXITSTATUS (status) == 0));
STATE (pid, 1 << STATE_ENOENT);
}
delay ();
i = tkill (inferior, SIGCONT);
assert (i == 0);
- /* This is a race, we may not prove the successful SIGALRM delivery by it. */
+ /* This is a race, we may not prove the successful SIGALRM delivery by it.
+ Rather recheck it below. */
STATE (inferior, 1 << STATE_RUNNING);
- murder (inferior);
+ delay ();
+ i = tkill (inferior, SIGSTOP);
+ assert (i == 0);
+ /* Wait till it gets stopped otherwise we may get STATE_ENOENT below. */
+ STATE (inferior, 1 << STATE_STOPPED);
+ delay ();
+ i = tkill (inferior, SIGUSR2);
+ assert (i == 0);
+ STATE (inferior, 1 << STATE_STOPPED);
+ delay ();
+ i = tkill (inferior, SIGCONT);
+ assert (i == 0);
+ /* Not just STATE_ZOMBIE as we can get spawn with waiter. FIXME. */
+ STATE (inferior, (1 << STATE_ENOENT) | (1 << STATE_ZOMBIE) | (1 << STATE_DEAD));
+ /* We would fail on: murder (inferior); */
}
static void *pass (void *data, void *input)
int loop = 0;
int i;
+#ifdef MEASURE_STATE_PERFORMANCE
+ STATE (1, 1 << STATE_ZOMBIE);
+ return 0;
+#endif /* MEASURE_STATE_PERFORMANCE */
+
if (argc == 1)
;
else if (argc == 2 && strcmp (argv[1], "-l") == 0)