public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4 3/5] syscalls/msgstress02: Convert into new api
Date: Wed, 21 Jul 2021 17:33:15 +0200	[thread overview]
Message-ID: <YPg+O2s0y/uUWiS7@yuki> (raw)
In-Reply-To: <1615550541-21714-3-git-send-email-xuyang2018.jy@cn.fujitsu.com>

Hi!
Generally looks much better, comments inline.

> -static int dotest(key_t key, int child_process)
> +static void dotest(key_t key, int child_process, int id)
>  {
> -	int id, pid;
> -	int i, count, status, exit_status;
> -
> -	sighold(SIGTERM);
> -	if ((id = msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)) < 0) {
> -		printf("msgget() error in child %d: %s\n",
> -			child_process, strerror(errno));
> -		return FAIL;
> -	}
> -	tid = id;
> -	sigrelse(SIGTERM);
> -
> -	exit_status = PASS;
> +	int pid, i, count;
>  
>  	for (i = 0; i < nkids; i++) {
> -		fflush(stdout);
> -		if ((pid = FORK_OR_VFORK()) < 0) {
> -			printf("Fork failure in the first child of child group %d\n",
> +		pid = fork();

Why don't we use SAFE_FORK() here as well?

I guess that the main point is to make sure that we cleanup the message
queueus that would otherwise stayed on the system.

...

> +	SAFE_SIGNAL(SIGTERM, SIG_IGN);

And here as well, I do not get why we ignore SIGTERM at all.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2021-07-21 15:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18  9:41 [LTP] [PATCH v2 1/2] libs/libltpnewipc: Add libnewmsgctl.c Yang Xu
2020-06-18  9:41 ` [LTP] [PATCH v2 2/2] syscalls/msgstress: scale number of processes accodingly to available RAM Yang Xu
2020-07-22 15:45   ` Cyril Hrubis
2020-07-23  6:34     ` Yang Xu
2020-10-21 12:57     ` [LTP] [PATCH v3 1/4] syscalls/msgstress: Add common file for msgstress Yang Xu
2020-10-21 12:57       ` [LTP] [PATCH v3 2/4] syscalls/msgstress*: cleanup and convert into new api Yang Xu
2020-11-11 16:31         ` Cyril Hrubis
2021-03-12 12:02           ` [LTP] [PATCH v4 1/5] libs/libltpnewipc/libnewipc.c: Add msg_do_reader/msg_do_writer function Yang Xu
2021-03-12 12:02             ` [LTP] [PATCH v4 2/5] syscalls/msgstress01: Convert into new api and merge msgstress03 into it Yang Xu
2021-07-21 15:07               ` Cyril Hrubis
2021-03-12 12:02             ` [LTP] [PATCH v4 3/5] syscalls/msgstress02: Convert into new api Yang Xu
2021-07-21 15:33               ` Cyril Hrubis [this message]
2021-03-12 12:02             ` [LTP] [PATCH v4 4/5] sycalls/msgstress04: " Yang Xu
2021-07-21 15:35               ` Cyril Hrubis
2021-03-12 12:02             ` [LTP] [PATCH v4 5/5] libs/libltpipc: Remove useless function and c file Yang Xu
2021-07-21 14:27             ` [LTP] [PATCH v4 1/5] libs/libltpnewipc/libnewipc.c: Add msg_do_reader/msg_do_writer function Cyril Hrubis
2021-07-21 15:29             ` Cyril Hrubis
2020-10-21 12:57       ` [LTP] [PATCH v3 3/4] libmsgctl: Remove it Yang Xu
2020-10-21 12:57       ` [LTP] [PATCH v3 4/4] lipipc: Remove useless get_max_msgqueues api Yang Xu
2020-11-11 15:44       ` [LTP] [PATCH v3 1/4] syscalls/msgstress: Add common file for msgstress Cyril Hrubis
2020-11-13  6:14         ` Yang Xu
2020-11-13 15:26           ` Cyril Hrubis
2020-06-24  5:04 ` [LTP] [PATCH v2 1/2] libs/libltpnewipc: Add libnewmsgctl.c Yang Xu
2020-07-16  1:07   ` Yang Xu
2020-07-22 15:01 ` Cyril Hrubis
2020-07-23  6:29   ` Yang Xu

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=YPg+O2s0y/uUWiS7@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox