From: Luis R. Rodriguez Date: Tue, 12 Jun 2018 16:05:40 +0000 (-0500) Subject: xfsprogs: reset opterr on platform_getoptreset() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ebba895756f82203234351c8150705698c9dcb4;p=thirdparty%2Fxfsprogs-dev.git xfsprogs: reset opterr on platform_getoptreset() 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 Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/include/darwin.h b/include/darwin.h index 2632e1d6f..4c23a1a3f 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 1db3f4f01..26e5d9e08 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 1998941a6..a9273239c 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)