blob: 5676e074f15e2fefcfdf80d42b010f154d18c74d [file] [log] [blame] [raw]
Use ToolBox getopt to support options appear in any order (GNU style).
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sbin/mount/Makefile freebsd-11.1/usr/src/sbin/mount/Makefile
--- /usr/src/sbin/mount/Makefile 2017-07-21 07:43:26.000000000 +0800
+++ freebsd-11.1/usr/src/sbin/mount/Makefile 2019-03-22 14:06:42.916306000 +0800
@@ -7,6 +7,7 @@
MAN= mount.8 mount.conf.8
# We do NOT install the getmntopts.3 man page.
+LDADD= -L /usr/home/WHR/src/ToolBox/libgetopt -l getopt
LIBADD= util
.include <bsd.prog.mk>
Only in freebsd-11.1/usr/src/sbin/mount: Makefile.rej
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sbin/mount/mount_fs.c freebsd-11.1/usr/src/sbin/mount/mount_fs.c
--- /usr/src/sbin/mount/mount_fs.c 2017-07-21 07:43:26.000000000 +0800
+++ freebsd-11.1/usr/src/sbin/mount/mount_fs.c 2019-03-22 14:00:28.401125000 +0800
@@ -90,7 +90,8 @@
iov = NULL;
iovlen = 0;
- optind = optreset = 1; /* Reset for parse of new argv. */
+ optreset = 1; /* Reset for parse of new argv. */
+ optind = 0;
while ((ch = getopt(argc, argv, "o:")) != -1) {
switch(ch) {
case 'o':