]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: reset opterr on platform_getoptreset()
authorLuis R. Rodriguez <mcgrof@kernel.org>
Tue, 12 Jun 2018 16:05:40 +0000 (11:05 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 12 Jun 2018 16:05:40 +0000 (11:05 -0500)
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>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/darwin.h
include/gnukfreebsd.h
include/linux.h

index 2632e1d6f08c12f0c152665098a37690b49c1183..4c23a1a3f739560157bb96af90e60df6311f0c33 100644 (file)
@@ -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)
index 1db3f4f010e3543984c6c76ebc04eaf3df31da5b..26e5d9e08cd58658777bc1c18dfc2caabcba2f24 100644 (file)
@@ -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)
index 1998941a6df5935df8e033560b0026457f7cb40f..a9273239c41948420d5acca11a0dc6a3929e104e 100644 (file)
@@ -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)