[LTP] [PATCH] lib/tst_test.c: Bugfix for heartbeat
zhaogongyi
zhaogongyi@huawei.com
Tue Apr 13 13:54:54 CEST 2021
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
More information about the ltp
mailing list