All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] syscalls/shmdt01: Convert into new api
Date: Wed, 27 Apr 2022 17:14:49 +0200	[thread overview]
Message-ID: <Ymld6Z6zaWVoz0T5@yuki> (raw)
In-Reply-To: <1651034362-18672-1-git-send-email-xuyang2018.jy@fujitsu.com>

Hi!
> +static int shm_id = -1, shm_key, pass;
> +static int *shared;
>  sigjmp_buf env;

^ static sigjmp_buf

> +static void check_functionality(void)
>  {
> -	/* stat the shared memory segment */
> -	if (shmctl(shm_id_1, IPC_STAT, &buf) == -1)
> -		tst_brkm(TBROK | TERRNO, cleanup,
> -			 "could not stat in signal handler");
> +	struct shmid_ds buf;
>  
> +	SAFE_SHMCTL(shm_id, IPC_STAT, &buf);
>  	if (buf.shm_nattch != 0) {
> -		tst_resm(TFAIL, "# of attaches is incorrect");
> +		tst_res(TFAIL, "Number of attaches(%ld) is non-zero", buf.shm_nattch);
>  		return;
>  	}

Maybe just:

	TST_EXP_EQ_LI(buf.shm_nattch, 0);

	if (buf.shm_nattach)
		return;



Other than these two:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>


-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2022-04-27 15:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  4:39 [LTP] [PATCH 1/2] syscalls/shmdt01: Convert into new api Yang Xu
2022-04-27  4:39 ` [LTP] [PATCH 2/2] syscalls/shmdt02: " Yang Xu
2022-06-01 14:19   ` Cyril Hrubis
2022-04-27 15:14 ` Cyril Hrubis [this message]
2022-04-28  2:59   ` [LTP] [PATCH v2] syscalls/shmdt01: " Yang Xu
2022-06-01 13:14     ` Cyril Hrubis

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=Ymld6Z6zaWVoz0T5@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=xuyang2018.jy@fujitsu.com \
    /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.