getopt_long_only does not exist on NetBSD getopt, so replacing it with getopt_long

This commit is contained in:
Nils 2016-08-07 17:24:39 +02:00
parent b4cb910438
commit 57ba1de7a2
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ void parse_cmdline(int argc, char* argv[])
}; };
struct addrinfo **a; struct addrinfo **a;
while ((c = getopt_long_only(argc, argv, "l:p:", options, NULL)) != -1) { while ((c = getopt_long(argc, argv, "l:p:", options, NULL)) != -1) {
if (c == 0) continue; if (c == 0) continue;
switch (c) { switch (c) {

View File

@ -444,7 +444,7 @@ static void cmdline_config(int argc, char* argv[], struct proto** prots)
#ifdef LIBCONFIG #ifdef LIBCONFIG
optind = 1; optind = 1;
opterr = 0; /* we're missing protocol options at this stage so don't output errors */ opterr = 0; /* we're missing protocol options at this stage so don't output errors */
while ((c = getopt_long_only(argc, argv, optstr, all_options, NULL)) != -1) { while ((c = getopt_long(argc, argv, optstr, all_options, NULL)) != -1) {
if (c == 'v') { if (c == 'v') {
verbose++; verbose++;
} }
@ -481,7 +481,7 @@ static void parse_cmdline(int argc, char* argv[], struct proto* prots)
optind = 1; optind = 1;
opterr = 1; opterr = 1;
next_arg: next_arg:
while ((c = getopt_long_only(argc, argv, optstr, all_options, NULL)) != -1) { while ((c = getopt_long(argc, argv, optstr, all_options, NULL)) != -1) {
if (c == 0) continue; if (c == 0) continue;
if (c >= PROT_SHIFT) { if (c >= PROT_SHIFT) {