From e127d441707371cb15ae731173306f01efaf4117 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 25 Apr 2011 09:42:50 +0700 Subject: [PATCH] Show error for --makepem if compiled without SSL. --- main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index 381c7e8c..17bbbd2f 100644 --- a/main.cpp +++ b/main.cpp @@ -40,9 +40,7 @@ static const struct option g_LongOpts[] = { { "allow-root", no_argument, 0, 'r' }, { "makeconf", no_argument, 0, 'c' }, { "makepass", no_argument, 0, 's' }, -#ifdef HAVE_LIBSSL { "makepem", no_argument, 0, 'p' }, -#endif /* HAVE_LIBSSL */ { "datadir", required_argument, 0, 'd' }, { 0, 0, 0, 0 } }; @@ -131,11 +129,9 @@ int main(int argc, char** argv) { #endif #ifdef HAVE_LIBSSL bool bMakePem = false; +#endif while ((iArg = getopt_long(argc, argv, "hvnrcspd:Df", g_LongOpts, &iOptIndex)) != -1) { -#else - while ((iArg = getopt_long(argc, argv, "hvnrcsd:Df", g_LongOpts, &iOptIndex)) != -1) { -#endif /* HAVE_LIBSSL */ switch (iArg) { case 'h': GenerateHelp(argv[0]); @@ -155,10 +151,13 @@ int main(int argc, char** argv) { case 's': bMakePass = true; break; -#ifdef HAVE_LIBSSL case 'p': +#ifdef HAVE_LIBSSL bMakePem = true; break; +#else + CUtils::PrintError("ZNC is compiled without SSL support."); + return 1; #endif /* HAVE_LIBSSL */ case 'd': sDataDir = CString(optarg);