[LTP] [PATCH] syscalls/fanotify: Kill the child process before exit
Petr Vorel
pvorel@suse.cz
Fri Nov 5 09:29:25 CET 2021
Hi all,
...
> This would be the obvious solution.
> But simpler to skip zero values then stop the iterator.
+1
> This makes the cleanup helper reenetrant:
> static int stop_children(void)
> {
> int child_ret;
> int i, ret = 0;
> for (i = 0; i < MAX_CHILDREN; i++) {
> if (!child_pid[i]) continue;
> SAFE_KILL(child_pid[i], SIGKILL);
> }
> for (i = 0; i < MAX_CHILDREN; i++) {
> if (!child_pid[i]) continue;
> SAFE_WAITPID(child_pid[i], &child_ret, 0);
> if (!WIFSIGNALED(child_ret))
> ret = 1;
> child_pid[i] = 0;
> }
> return ret;
> }
Amir, thanks! Zhao, could you please test this in your setup?
(+ please be verbose about your setup, it helps to decide in the future that fix
is still needed).
Kind regards,
Petr
> Thanks,
> Amir.
More information about the ltp
mailing list