From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Cc: darrick.wong@oracle.com, jack@suse.com, jeffm@suse.com,
okurz@suse.com, lpechacek@suse.com, jtulak@redhat.com,
"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH v6 4/5] xfsprogs: reset opterr on platform_getoptreset()
Date: Mon, 11 Jun 2018 17:30:38 -0700 [thread overview]
Message-ID: <20180612003039.17154-5-mcgrof@kernel.org> (raw)
In-Reply-To: <20180612003039.17154-1-mcgrof@kernel.org>
Setting opterr = 0 is useful if you want to only parse a subset of
paremeters first. Later you will have to set opterr = 1 again, but
we already have a platform_getoptreset() and its expected to be used
in these contexts so just sprinkle it there.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
include/darwin.h | 1 +
include/gnukfreebsd.h | 1 +
include/linux.h | 1 +
3 files changed, 3 insertions(+)
diff --git a/include/darwin.h b/include/darwin.h
index 2632e1d6f08c..4c23a1a3f739 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -79,6 +79,7 @@ static __inline__ void platform_getoptreset(void)
{
extern int optreset;
optreset = 0;
+ opterr = 1;
}
static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2)
diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
index 1db3f4f010e3..26e5d9e08cd5 100644
--- a/include/gnukfreebsd.h
+++ b/include/gnukfreebsd.h
@@ -83,6 +83,7 @@ static __inline__ void platform_getoptreset(void)
{
extern int optind;
optind = 0;
+ opterr = 1;
}
static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2)
diff --git a/include/linux.h b/include/linux.h
index 1998941a6df5..a9273239c419 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -88,6 +88,7 @@ static __inline__ void platform_getoptreset(void)
{
extern int optind;
optind = 0;
+ opterr = 1;
}
static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2)
--
2.16.3
next prev parent reply other threads:[~2018-06-12 0:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 0:30 [PATCH v6 0/5] xfsprogs: add mkfs.xfs configuration file parsing support Luis R. Rodriguez
2018-06-12 0:30 ` [PATCH v6 1/5] mkfs: distinguish between struct sb_feat_args and struct cli_params Luis R. Rodriguez
2018-06-12 0:30 ` [PATCH v6 2/5] mkfs: move shared config structs and into their own headers Luis R. Rodriguez
2018-06-12 0:30 ` [PATCH v6 3/5] mkfs: replace defaults source with an enum Luis R. Rodriguez
2018-06-12 0:30 ` Luis R. Rodriguez [this message]
2018-06-12 0:30 ` [PATCH v6 5/5] mkfs.xfs: add configuration file parsing support using our own parser Luis R. Rodriguez
2018-06-12 16:46 ` [PATCH v6 0/5] xfsprogs: add mkfs.xfs configuration file parsing support Eric Sandeen
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=20180612003039.17154-5-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=darrick.wong@oracle.com \
--cc=jack@suse.com \
--cc=jeffm@suse.com \
--cc=jtulak@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=lpechacek@suse.com \
--cc=okurz@suse.com \
--cc=sandeen@sandeen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.