| Use ToolBox getopt to support options appear in any order (GNU style). |
| |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/sbin/mount/Makefile freebsd-10.4/sbin/mount/Makefile |
| --- /var/archive3/public/freebsd-releng-10.4-src/sbin/mount/Makefile 2017-09-29 08:21:17.000000000 +0800 |
| +++ freebsd-10.4/sbin/mount/Makefile 2019-08-18 09:53:26.516186290 +0800 |
| @@ -7,6 +7,6 @@ |
| # We do NOT install the getmntopts.3 man page. |
| |
| DPADD= ${LIBUTIL} |
| -LDADD= -lutil |
| +LDADD= -lutil -L /usr/home/WHR/src/ToolBox/libgetopt -l getopt |
| |
| .include <bsd.prog.mk> |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/sbin/mount/mount_fs.c freebsd-10.4/sbin/mount/mount_fs.c |
| --- /var/archive3/public/freebsd-releng-10.4-src/sbin/mount/mount_fs.c 2017-09-29 08:21:17.000000000 +0800 |
| +++ freebsd-10.4/sbin/mount/mount_fs.c 2019-08-18 09:53:26.516186290 +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': |