From: Pekka Riikonen Date: Sun, 24 Apr 2005 14:30:40 +0000 (+0000) Subject: Use getopt() if getopt_long() isn't present. X-Git-Tag: silc.server.0.9.20~23 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=a7f0673f09a68b4bc4dd6a9ee4b270aaded817e3 Use getopt() if getopt_long() isn't present. --- 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();