public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] syscalls/quotatcl01.c: Rewrite && Convert to new API
Date: Mon, 24 Oct 2016 12:49:28 +0200	[thread overview]
Message-ID: <20161024104928.GA19167@rei.lan> (raw)
In-Reply-To: <1477032835-11570-1-git-send-email-yangx.jy@cn.fujitsu.com>

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.

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2016-10-24 10:49 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 ` Cyril Hrubis [this message]
2016-10-25  6:08   ` [LTP] [PATCH 1/2] syscalls/quotatcl01.c: Rewrite && " Xiao Yang
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=20161024104928.GA19167@rei.lan \
    --to=chrubis@suse.cz \
    --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