From c416bbdad253b83620754b0aa2ce0a62b86f23fe Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 16 Jan 2020 16:36:59 +0100 Subject: [PATCH] src/main.cpp: consume "--threads" flag even if not supported (so we dont break scripts) --- src/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b968380..d5f43b0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -129,15 +129,20 @@ int main(int argc, char **argv) { p++; } -#ifdef HAVE_THREADS if (p < argc && !memcmp(argv[p], "--threads=", 10)) { +#ifdef HAVE_THREADS option_num_threads = atoi(argv[p] + 10); if (option_num_threads < 2) { option_num_threads = 2; } +#else + // Even if we dont have threads. we consume the flag. + // otherwise we might break scripts. Print a nice message instead. + std::cerr << "NOTICE: eosio-keygen is not compiled with" + << " thread support. this option is ignored." << std::endl; +#endif /* HAVE_THREADS */ p++; } -#endif /* HAVE_THREADS */ if (argc <= p) { std::cout << "You must specify a word list." << std::endl;