From: DAN LI <li.dan@cn.fujitsu.com>
To: Jan Stancek <jstancek@redhat.com>
Cc: LTP list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH] semctl01.c: Pass the correct parameter
Date: Wed, 22 May 2013 09:47:34 +0800 [thread overview]
Message-ID: <519C23B6.1030000@cn.fujitsu.com> (raw)
In-Reply-To: <464527248.5091039.1369131720554.JavaMail.root@redhat.com>
On 05/21/2013 06:22 PM, Jan Stancek wrote:
>
>
>
>
> ----- 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?
Sounds better.;)
Thank you for reviewing.
Regards,
DAN LI
>
> 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
prev parent reply other threads:[~2013-05-22 1:50 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
2013-05-22 1:47 ` DAN LI [this message]
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=519C23B6.1030000@cn.fujitsu.com \
--to=li.dan@cn.fujitsu.com \
--cc=jstancek@redhat.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