All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] semop/semop04.c: fix a bug when running with -i option
Date: Tue, 24 Dec 2013 06:20:19 -0500 (EST)	[thread overview]
Message-ID: <1047061580.9198618.1387884019826.JavaMail.root@redhat.com> (raw)
In-Reply-To: <52B960D4.5050506@cn.fujitsu.com>





----- Original Message -----
> From: "Xiaoguang Wang" <wangxg.fnst@cn.fujitsu.com>
> To: ltp-list@lists.sourceforge.net
> Sent: Tuesday, 24 December, 2013 11:24:20 AM
> Subject: [LTP] [PATCH] semop/semop04.c: fix a bug when running with -i option
> 
> If we run semop04 like this: ./semop04 -i 2,
> its output will be:
> 
> semop04     1  TPASS  :  expected failure - errno = 11 : Resource temporarily
> unavailable
> semop04     2  TPASS  :  expected failure - errno = 11 : Resource temporarily
> unavailable
> semop04     1  TBROK  :  semctl() failed
> semop04     2  TBROK  :  Remaining cases broken.
> 
> Actually in the second iteration, semctl will return ERANGE. This is
> because the val variable will be less than zero in the sceond iteration.
> 
> Variable val should be reset to 1 before this actual errno test.
> 
> Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>

Looks good:

Reviewed-by: Jan Stancek <jstancek@redhat.com>

> ---
>  testcases/kernel/syscalls/ipc/semop/semop04.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/ipc/semop/semop04.c
> b/testcases/kernel/syscalls/ipc/semop/semop04.c
> index 2725378..f7efd86 100644
> --- a/testcases/kernel/syscalls/ipc/semop/semop04.c
> +++ b/testcases/kernel/syscalls/ipc/semop/semop04.c
> @@ -80,7 +80,7 @@ int main(int ac, char **av)
>  {
>  	int lc;
>  	char *msg;
> -	int val = 1;		/* value for SETVAL */
> +	int val;		/* value for SETVAL */
>  
>  	int i;
>  
> @@ -96,6 +96,7 @@ int main(int ac, char **av)
>  		/* reset tst_count in case we are looping */
>  		tst_count = 0;
>  
> +		val = 1;
>  		for (i = 0; i < TST_TOTAL; i++) {
>  
>  			/* initialize the s_buf buffer */
> --
> 1.8.2.1
> 
> 
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2013-12-24 11:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24 10:24 [LTP] [PATCH] semop/semop04.c: fix a bug when running with -i option Xiaoguang Wang
2013-12-24 11:20 ` Jan Stancek [this message]
2013-12-25  0:59 ` Wanlong Gao

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=1047061580.9198618.1387884019826.JavaMail.root@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=wangxg.fnst@cn.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.