[PATCH v6 4/5] xfsprogs: reset opterr on platform_getoptreset()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux