* [PATCH 2/4] Simplify workaround for old glibc getsubopt()
@ 2016-06-18 14:52 Felix Janda
2016-06-18 15:38 ` Felix Janda
2016-06-22 12:45 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Felix Janda @ 2016-06-18 14:52 UTC (permalink / raw)
To: xfs
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
include/darwin.h | 1 -
include/freebsd.h | 2 --
include/gnukfreebsd.h | 2 --
include/irix.h | 2 --
include/linux.h | 4 +---
mkfs/xfs_mkfs.c | 16 ++++++++--------
repair/xfs_repair.c | 4 ++--
7 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/include/darwin.h b/include/darwin.h
index a52030d..45e0c03 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -160,7 +160,6 @@ typedef int64_t xfs_daddr_t;
#define EFSCORRUPTED 990 /* Filesystem is corrupted */
#define EFSBADCRC 991 /* Bad CRC detected */
-#define constpp char * const *
#define HAVE_FID 1
diff --git a/include/freebsd.h b/include/freebsd.h
index f7e0c75..6e77427 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -43,8 +43,6 @@
#define fdatasync fsync
#define memalign(a,sz) valloc(sz)
-#define constpp char * const *
-
#define EFSCORRUPTED 990 /* Filesystem is corrupted */
#define EFSBADCRC 991 /* Bad CRC detected */
diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
index 64167b2..d55acfb 100644
--- a/include/gnukfreebsd.h
+++ b/include/gnukfreebsd.h
@@ -33,8 +33,6 @@
#include <paths.h>
#include <mntent.h>
-#define constpp char * const *
-
#define EFSCORRUPTED 990 /* Filesystem is corrupted */
#define EFSBADCRC 991 /* Bad CRC detected */
diff --git a/include/irix.h b/include/irix.h
index c2191ee..b92e01b 100644
--- a/include/irix.h
+++ b/include/irix.h
@@ -184,8 +184,6 @@ typedef struct xfs_efd_log_format_32 {
#define inline __inline
#endif
-#define constpp char * const *
-
/*ARGSUSED*/
static __inline__ int xfsctl(const char *path, int fd, int cmd, void *arg)
{
diff --git a/include/linux.h b/include/linux.h
index b94de81..f6d0f80 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -133,9 +133,7 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
}
#if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 1))
-# define constpp const char * const *
-#else
-# define constpp char * const *
+# define getsubopt(p, s, v) getsubopt(p, (const char * const *)s, v)
#endif
#define ENOATTR ENODATA /* Attribute not found */
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 955dcfd..99c5eb5 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -1829,7 +1829,7 @@ main(
char **subopts = (char **)bopts.subopts;
char *value;
- switch (getsubopt(&p, (constpp)subopts,
+ switch (getsubopt(&p, subopts,
&value)) {
case B_LOG:
blocklog = getnum(value, &bopts, B_LOG);
@@ -1853,7 +1853,7 @@ main(
char **subopts = (char **)dopts.subopts;
char *value;
- switch (getsubopt(&p, (constpp)subopts,
+ switch (getsubopt(&p, subopts,
&value)) {
case D_AGCOUNT:
agcount = getnum(value, &dopts,
@@ -1933,7 +1933,7 @@ main(
char **subopts = (char **)iopts.subopts;
char *value;
- switch (getsubopt(&p, (constpp)subopts,
+ switch (getsubopt(&p, subopts,
&value)) {
case I_ALIGN:
sb_feat.inode_align = getnum(value,
@@ -1983,7 +1983,7 @@ main(
char **subopts = (char **)lopts.subopts;
char *value;
- switch (getsubopt(&p, (constpp)subopts,
+ switch (getsubopt(&p, subopts,
&value)) {
case L_AGNUM:
logagno = getnum(value, &lopts, L_AGNUM);
@@ -2055,7 +2055,7 @@ main(
char **subopts = (char **)mopts.subopts;
char *value;
- switch (getsubopt(&p, (constpp)subopts,
+ switch (getsubopt(&p, subopts,
&value)) {
case M_CRC:
sb_feat.crcs_enabled =
@@ -2084,7 +2084,7 @@ main(
char **subopts = (char **)nopts.subopts;
char *value;
- switch (getsubopt(&p, (constpp)subopts,
+ switch (getsubopt(&p, subopts,
&value)) {
case N_LOG:
dirblocklog = getnum(value, &nopts,
@@ -2140,7 +2140,7 @@ main(
char **subopts = (char **)ropts.subopts;
char *value;
- switch (getsubopt(&p, (constpp)subopts,
+ switch (getsubopt(&p, subopts,
&value)) {
case R_EXTSIZE:
rtextsize = getstr(value, &ropts,
@@ -2173,7 +2173,7 @@ main(
char **subopts = (char **)sopts.subopts;
char *value;
- switch (getsubopt(&p, (constpp)subopts,
+ switch (getsubopt(&p, subopts,
&value)) {
case S_LOG:
case S_SECTLOG:
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index 9d91f2d..5a433ed 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -225,7 +225,7 @@ process_args(int argc, char **argv)
while (*p != '\0') {
char *val;
- switch (getsubopt(&p, (constpp)o_opts, &val)) {
+ switch (getsubopt(&p, o_opts, &val)) {
case ASSUME_XFS:
if (val)
noval('o', o_opts, ASSUME_XFS);
@@ -276,7 +276,7 @@ process_args(int argc, char **argv)
while (*p) {
char *val;
- switch (getsubopt(&p, (constpp)c_opts, &val)) {
+ switch (getsubopt(&p, c_opts, &val)) {
case CONVERT_LAZY_COUNT:
lazy_count = (int)strtol(val, NULL, 0);
convert_lazy_count = 1;
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/4] Simplify workaround for old glibc getsubopt()
2016-06-18 14:52 [PATCH 2/4] Simplify workaround for old glibc getsubopt() Felix Janda
@ 2016-06-18 15:38 ` Felix Janda
2016-06-22 12:45 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Felix Janda @ 2016-06-18 15:38 UTC (permalink / raw)
To: xfs
Please ignore this patch and the next:
The installed header linux.h should not redefine the
standard function getsubopt().
Instead might it be possible to remove the workaround all together?
glibc-2.2 (first version which does not need the workaround) was
released in 2000 and even with older glibc when removing the
workaround, it should only make the compiler emit a warning.
Felix
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/4] Simplify workaround for old glibc getsubopt()
2016-06-18 14:52 [PATCH 2/4] Simplify workaround for old glibc getsubopt() Felix Janda
2016-06-18 15:38 ` Felix Janda
@ 2016-06-22 12:45 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2016-06-22 12:45 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
I think we should simply kill that workaround. I even have vague
memories of killing it, but maybe I didn't end up sending out the patch.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-22 12:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-18 14:52 [PATCH 2/4] Simplify workaround for old glibc getsubopt() Felix Janda
2016-06-18 15:38 ` Felix Janda
2016-06-22 12:45 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox