From: Jan Stancek <jstancek@redhat.com>
To: DAN LI <li.dan@cn.fujitsu.com>
Cc: LTP list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH] semctl01.c: Pass the correct parameter
Date: Tue, 21 May 2013 06:22:00 -0400 (EDT) [thread overview]
Message-ID: <464527248.5091039.1369131720554.JavaMail.root@redhat.com> (raw)
In-Reply-To: <519B35A9.8090300@cn.fujitsu.com>
----- Original Message -----
> From: "DAN LI" <li.dan@cn.fujitsu.com>
> To: "LTP list" <ltp-list@lists.sourceforge.net>
> Sent: Tuesday, 21 May, 2013 10:51:53 AM
> Subject: [LTP] [PATCH] semctl01.c: Pass the correct parameter
>
>
> For SEM_STAT, the semid argument is not a semaphore identifier, but instead
> an
> index into the kernel’s internal array that maintains information about all
> semaphore sets on the system.
>
> Pass a correct index of the kernel' internal array intead of a semaphores id
> when
> testing feature SEM_STAT.
>
> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> ---
Hi,
that backup/restore of global variable in setup/cleanup funcs
between testcases looks a bit odd to me.
How about adding new field to test_case_t?
+static int sem_index = 0;
static struct test_case_t {
+ int *semid;
...
- TEST(semctl(sem_id_1, TC[i].semnum, TC[i].cmd,
+ TEST(semctl(*(TC[i].semid), TC[i].semnum, TC[i].cmd,
These you could initialise in TC[] definition to either &sem_id_1 or &sem_index
and avoid all that backup/restore of sem_id_1.
What do you think?
Regards,
Jan
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2013-05-21 10:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 8:51 [LTP] [PATCH] semctl01.c: Pass the correct parameter DAN LI
2013-05-21 10:22 ` Jan Stancek [this message]
2013-05-22 1:47 ` DAN LI
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=464527248.5091039.1369131720554.JavaMail.root@redhat.com \
--to=jstancek@redhat.com \
--cc=li.dan@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
/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