[LTP] [PATCH] lib/tst_test.c: Bugfix for heartbeat

Cyril Hrubis
2021-04-13T11:32:52Z

Hi!
> Thanks for your review!
>
> > > + } else
> > > + kill(getppid(), SIGUSR1);
> >
> > No need for the else branch here now that we do exit() a the end of the if
> > () block.
> >
>
> Generally speaking, It seems that we also need the else branch since we need to send heart beat to the main process.

What I meant was that the code could be structured as:

if (getppid() == 1) {
...
exit(TBROK);
}

kill(getppid(), SIGUSR1);

Hence there is no need for the else branch.

--
Cyril Hrubis
chrubis@suse.cz