From 57ba1de7a29a86f9ea434842d8b90585fa7d4421 Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 7 Aug 2016 17:24:39 +0200 Subject: [PATCH] getopt_long_only does not exist on NetBSD getopt, so replacing it with getopt_long --- echosrv.c | 2 +- sslh-main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/echosrv.c b/echosrv.c index 65a85c3..484a8e4 100644 --- a/echosrv.c +++ b/echosrv.c @@ -64,7 +64,7 @@ void parse_cmdline(int argc, char* argv[]) }; 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; switch (c) { diff --git a/sslh-main.c b/sslh-main.c index 3242cc4..81cba8a 100644 --- a/sslh-main.c +++ b/sslh-main.c @@ -444,7 +444,7 @@ static void cmdline_config(int argc, char* argv[], struct proto** prots) #ifdef LIBCONFIG optind = 1; 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') { verbose++; } @@ -481,7 +481,7 @@ static void parse_cmdline(int argc, char* argv[], struct proto* prots) optind = 1; opterr = 1; 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 >= PROT_SHIFT) {