[rtems-libbsd commit] commands: Use REQUIRE_ORDER option processing
Sebastian Huber
sebh at rtems.org
Wed Nov 13 13:04:09 UTC 2013
Module: rtems-libbsd
Branch: master
Commit: b4d6afd9f61013705b8b6cc9cb9998ee9fed451e
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=b4d6afd9f61013705b8b6cc9cb9998ee9fed451e
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Nov 12 09:40:54 2013 +0100
commands: Use REQUIRE_ORDER option processing
---
freebsd/sbin/ifconfig/ifconfig.c | 4 ++++
freebsd/sbin/ping/ping.c | 2 +-
freebsd/sbin/ping6/ping6.c | 2 +-
freebsd/sbin/route/route.c | 2 +-
freebsd/usr.bin/netstat/main.c | 2 +-
5 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/freebsd/sbin/ifconfig/ifconfig.c b/freebsd/sbin/ifconfig/ifconfig.c
index 6c7b8a3..43b8ea4 100644
--- a/freebsd/sbin/ifconfig/ifconfig.c
+++ b/freebsd/sbin/ifconfig/ifconfig.c
@@ -214,7 +214,11 @@ main(int argc, char *argv[])
all = downonly = uponly = namesonly = noload = verbose = 0;
/* Parse leading line options */
+#ifndef __rtems__
strlcpy(options, "adklmnuv", sizeof(options));
+#else /* __rtems__ */
+ strlcpy(options, "+adklmnuv", sizeof(options));
+#endif /* __rtems__ */
for (p = opts; p != NULL; p = p->next)
strlcat(options, p->opt, sizeof(options));
while ((c = getopt(argc, argv, options)) != -1) {
diff --git a/freebsd/sbin/ping/ping.c b/freebsd/sbin/ping/ping.c
index b45efa6..f64245c 100644
--- a/freebsd/sbin/ping/ping.c
+++ b/freebsd/sbin/ping/ping.c
@@ -316,7 +316,7 @@ main(int argc, char **argv)
#define optarg getopt_data.optarg
#define opterr getopt_data.opterr
#define optopt getopt_data.optopt
-#define getopt(argc, argv, opt) getopt_r(argc, argv, opt, &getopt_data)
+#define getopt(argc, argv, opt) getopt_r(argc, argv, "+" opt, &getopt_data)
#endif /* __rtems__ */
payload = source = NULL;
diff --git a/freebsd/sbin/ping6/ping6.c b/freebsd/sbin/ping6/ping6.c
index b2ad633..9553890 100644
--- a/freebsd/sbin/ping6/ping6.c
+++ b/freebsd/sbin/ping6/ping6.c
@@ -403,7 +403,7 @@ main(int argc, char *argv[])
#define optarg getopt_data.optarg
#define opterr getopt_data.opterr
#define optopt getopt_data.optopt
-#define getopt(argc, argv, opt) getopt_r(argc, argv, opt, &getopt_data)
+#define getopt(argc, argv, opt) getopt_r(argc, argv, "+" opt, &getopt_data)
#endif /* __rtems__ */
/* just to be sure */
diff --git a/freebsd/sbin/route/route.c b/freebsd/sbin/route/route.c
index cc5c7d0..1e09589 100644
--- a/freebsd/sbin/route/route.c
+++ b/freebsd/sbin/route/route.c
@@ -251,7 +251,7 @@ main(int argc, char **argv)
#define optarg getopt_data.optarg
#define opterr getopt_data.opterr
#define optopt getopt_data.optopt
-#define getopt(argc, argv, opt) getopt_r(argc, argv, opt, &getopt_data)
+#define getopt(argc, argv, opt) getopt_r(argc, argv, "+" opt, &getopt_data)
#endif /* __rtems__ */
#ifndef __rtems__
diff --git a/freebsd/usr.bin/netstat/main.c b/freebsd/usr.bin/netstat/main.c
index 557d1ca..0034eb9 100644
--- a/freebsd/usr.bin/netstat/main.c
+++ b/freebsd/usr.bin/netstat/main.c
@@ -436,7 +436,7 @@ main(int argc, char *argv[])
#define optarg getopt_data.optarg
#define opterr getopt_data.opterr
#define optopt getopt_data.optopt
-#define getopt(argc, argv, opt) getopt_r(argc, argv, opt, &getopt_data)
+#define getopt(argc, argv, opt) getopt_r(argc, argv, "+" opt, &getopt_data)
#endif /* __rtems__ */
af = AF_UNSPEC;
More information about the vc
mailing list