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

zhaogongyi
2021-04-13T11:54:54Z

Hi Cyril,

Thanks so much!

I have resubmit the patch according your review.

Best Regards,
Gongyi

>
> 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