| Use ToolBox getopt to support options appear in any order (GNU style). |
| |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/tmp/freebsd-10.3-src/usr/src/sbin/mount/Makefile freebsd-10.3/usr/src/sbin/mount/Makefile |
| --- /var/tmp/freebsd-10.3-src/usr/src/sbin/mount/Makefile 2016-03-25 09:10:18.000000000 +0800 |
| +++ freebsd-10.3/usr/src/sbin/mount/Makefile 2018-11-06 02:13:24.668128274 +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/tmp/freebsd-10.3-src/usr/src/sbin/mount/mount_fs.c freebsd-10.3/usr/src/sbin/mount/mount_fs.c |
| --- /var/tmp/freebsd-10.3-src/usr/src/sbin/mount/mount_fs.c 2016-03-25 09:10:18.000000000 +0800 |
| +++ freebsd-10.3/usr/src/sbin/mount/mount_fs.c 2018-11-07 23:40:42.618722341 +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': |