public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] syscalls/quotatcl01.c: Rewrite && Convert to new API
Date: Tue, 25 Oct 2016 14:08:55 +0800	[thread overview]
Message-ID: <580EF6F7.5090507@cn.fujitsu.com> (raw)
In-Reply-To: <20161024104928.GA19167@rei.lan>

On 2016/10/24 18:49, Cyril Hrubis wrote:
> Hi!
>> -	tst_parse_opts(ac, av, (option_t *) opts, NULL);
>> +	pid = SAFE_FORK();
>> +	if (!pid)
>> +		create_qf();
>>
>> -	setup();
>> +	SAFE_WAITPID(pid, NULL, 0);
> Just use tst_run_cmd() instead of the fork(), execlp(), wait() combo and
> remove the forks_child flag.
>
>> -	for (lc = 0; TEST_LOOPING(lc); ++lc) {
>> +	test_id = geteuid();
>>
>> -		tst_count = 0;
>> +	sprintf(usr_path, "%s/%s", mntpoint, usr_qf);
>> +	sprintf(grp_path, "%s/%s", mntpoint, grp_qf);
> Well these strings could be compile time constants. If you do:
>
> #define MNTPOINT "mntpoint"
>
> #ifdef HAVE_QUOTAV2
> # define USR_PATH MNTPOINT "aquota.user"
> ...
> #else
> # define USR_PATH MNTPOINT "quota.user"
> ...
> #endif
>
> But that is a minor issue.
>
> And yes, the inner block of #ifdef should ideally be indented with
> single space per block as in the example snipped above, but that is even
> more minor.
>
Hi Cyril,

Thanks for your review, I will rewrite it as you said.

Thanks,
Xiao Yang



  reply	other threads:[~2016-10-25  6:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21  6:53 [LTP] [PATCH 1/2] syscalls/quotatcl01.c: Rewrite && Convert to new API Xiao Yang
2016-10-21  6:53 ` [LTP] [PATCH 2/2] syscalls/quotactl02.c: Reconstruct and " Xiao Yang
2016-10-24 10:49 ` [LTP] [PATCH 1/2] syscalls/quotatcl01.c: Rewrite && " Cyril Hrubis
2016-10-25  6:08   ` Xiao Yang [this message]
2016-10-25  6:15   ` [LTP] [PATCH v2] " Xiao Yang
2016-10-31 10:11     ` Cyril Hrubis
2016-10-31 10:20       ` Xiao Yang
2016-10-31 11:33       ` [LTP] [PATCH] syscalls/quotactl02.c: Reconstruct and " Xiao Yang
2016-10-31 13:25         ` Cyril Hrubis
2016-11-01  8:33           ` [LTP] [PATCH v2] syscalls/quotactl02.c: Reconstruct && " Xiao Yang
2016-11-01 15:52             ` 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=580EF6F7.5090507@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.com \
    --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