From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/statx05: add mkfs.ext4 package version check
Date: Fri, 30 Oct 2020 14:12:14 +0100 [thread overview]
Message-ID: <20201030131214.GA32451@yuki.lan> (raw)
In-Reply-To: <20201029140031.40968-1-po-hsu.lin@canonical.com>
Hi!
> + int ret, rc, major, minor, patch;
> +
> + f = SAFE_POPEN("mkfs.ext4 -V 2>&1 | awk '/mke2fs/ {print $2}'", "r");
> + rc = fscanf(f, "%d.%d.%d", &major, &minor, &patch);
I wonder if the awk is necessary, it may produce TWARN on minimal
embedded systems where awk is not present. Why can't we use scanf() instead?
As far as I can tell fscanf(f, "mke2fs %d.%d.%d", &major, &minor,
&patch); should work fine without the awk.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2020-10-30 13:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 14:00 [LTP] [PATCH] syscalls/statx05: add mkfs.ext4 package version check Po-Hsu Lin
2020-10-30 13:12 ` Cyril Hrubis [this message]
2020-11-02 2:43 ` Po-Hsu Lin
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=20201030131214.GA32451@yuki.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