All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib/tst_test.c: Bugfix for heartbeat
Date: Tue, 13 Apr 2021 13:32:52 +0200	[thread overview]
Message-ID: <YHWBZLHgDx1q9kIb@yuki> (raw)
In-Reply-To: <F3D3F6AC3820BB4C9FCA340DB5C32CB4038B4974@dggeml531-mbx.china.huawei.com>

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

  reply	other threads:[~2021-04-13 11:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 10:52 [LTP] [PATCH] lib/tst_test.c: Bugfix for heartbeat zhaogongyi
2021-04-13 11:32 ` Cyril Hrubis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-15 12:11 zhaogongyi
2021-04-15 13:58 ` Petr Vorel
2021-04-13 11:54 zhaogongyi
2021-04-13 11:54 Zhao Gongyi
2021-04-15 11:32 ` Cyril Hrubis
2021-04-15 14:05   ` Cyril Hrubis
2021-04-13  8:19 zhaogongyi
2021-04-13  9:37 ` Cyril Hrubis
2021-04-13  6:42 zhaogongyi
2021-04-13  7:42 ` Cyril Hrubis
2021-03-23 13:56 Zhao Gongyi
2021-04-12 15:10 ` Cyril Hrubis
2021-04-15  7:52 ` Petr Vorel
2021-04-15 11:31   ` Cyril Hrubis
2021-04-15 14:03     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHWBZLHgDx1q9kIb@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.