Support getopt()/get_opt_long() parsing rewind (ala optind = 0) as used in opensm.
signed-off-by: stan smith <[email protected]> --- a/etc/user/getopt.c Fri May 21 09:04:30 2010 +++ b/etc/user/getopt.c Fri May 21 09:00:20 2010 @@ -45,6 +45,11 @@ optarg = NULL; + if (optind == 0) { + optind = opterr = 1; + optopt = '?'; + } + if (optind >= argc) { return EOF; } @@ -102,6 +107,12 @@ char arg[256]; char *str; int i; + + if (optind == 0) { + optarg = NULL; + optind = opterr = 1; + optopt = '?'; + } if (optind == argc) { return EOF; _______________________________________________ ofw mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
