From a7f0673f09a68b4bc4dd6a9ee4b270aaded817e3 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 24 Apr 2005 14:30:40 +0000 Subject: [PATCH] Use getopt() if getopt_long() isn't present. --- apps/silcd/silcd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/silcd/silcd.c b/apps/silcd/silcd.c index 10222098..a19a4c72 100644 --- a/apps/silcd/silcd.c +++ b/apps/silcd/silcd.c @@ -33,6 +33,7 @@ static SilcServer silcd; static void silc_usage(void); +#ifdef HAVE_GETOPT_LONG /* Long command line options */ static struct option long_opts[] = { @@ -53,6 +54,7 @@ static struct option long_opts[] = { NULL, 0, NULL, 0 } }; +#endif /* HAVE_GETOPT_LONG */ /* Command line option variables */ static char *opt_keypath = NULL; @@ -590,8 +592,12 @@ int main(int argc, char **argv) /* Parse command line arguments */ if (argc > 1) { +#ifdef HAVE_GETOPT_LONG while ((opt = getopt_long(argc, argv, "f:p:d:D:xhFVC:", long_opts, &option_index)) != EOF) { +#else + while ((opt = getopt(argc, argv, "f:p:d:D:xhFVC:")) != EOF) { +#endif /* HAVE_GETOPT_LONG */ switch(opt) { case 'h': silc_usage(); -- 2.43.0