diff options
Diffstat (limited to 'searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp')
-rw-r--r-- | searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp b/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp index 5fb359e5e9c..9b5956d3910 100644 --- a/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp +++ b/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp @@ -28,6 +28,7 @@ #include <getopt.h> #include <iostream> #include <thread> +#include <unistd.h> #include <vespa/log/log.h> LOG_SETUP("vespa-feed-bm"); @@ -241,7 +242,6 @@ bool App::get_options() { int c; - const char *opt_argument = nullptr; int long_opt_index = 0; static struct option long_opts[] = { { "bucket-db-stripe-bits", 1, nullptr, 0 }, @@ -296,23 +296,22 @@ App::get_options() LONGOPT_USE_MESSAGE_BUS, LONGOPT_USE_STORAGE_CHAIN }; - int opt_index = 1; - resetOptIndex(opt_index); - while ((c = GetOptLong("", opt_argument, opt_index, long_opts, &long_opt_index)) != -1) { + optind = 1; + while ((c = getopt_long(_argc, _argv, "", long_opts, &long_opt_index)) != -1) { switch (c) { case 0: switch(long_opt_index) { case LONGOPT_BUCKET_DB_STRIPE_BITS: - _bm_params.set_bucket_db_stripe_bits(atoi(opt_argument)); + _bm_params.set_bucket_db_stripe_bits(atoi(optarg)); break; case LONGOPT_CLIENT_THREADS: - _bm_params.set_client_threads(atoi(opt_argument)); + _bm_params.set_client_threads(atoi(optarg)); break; case LONGOPT_DISTRIBUTOR_STRIPES: - _bm_params.set_distributor_stripes(atoi(opt_argument)); + _bm_params.set_distributor_stripes(atoi(optarg)); break; case LONGOPT_DOCUMENTS: - _bm_params.set_documents(atoi(opt_argument)); + _bm_params.set_documents(atoi(optarg)); break; case LONGOPT_ENABLE_DISTRIBUTOR: _bm_params.set_enable_distributor(true); @@ -321,40 +320,40 @@ App::get_options() _bm_params.set_enable_service_layer(true); break; case LONGOPT_GET_PASSES: - _bm_params.set_get_passes(atoi(opt_argument)); + _bm_params.set_get_passes(atoi(optarg)); break; case LONGOPT_GROUPS: - _bm_params.set_groups(atoi(opt_argument)); + _bm_params.set_groups(atoi(optarg)); break; case LONGOPT_INDEXING_SEQUENCER: - _bm_params.set_indexing_sequencer(opt_argument); + _bm_params.set_indexing_sequencer(optarg); break; case LONGOPT_MAX_PENDING: - _bm_params.set_max_pending(atoi(opt_argument)); + _bm_params.set_max_pending(atoi(optarg)); break; case LONGOPT_NODES_PER_GROUP: - _bm_params.set_nodes_per_group(atoi(opt_argument)); + _bm_params.set_nodes_per_group(atoi(optarg)); break; case LONGOPT_PUT_PASSES: - _bm_params.set_put_passes(atoi(opt_argument)); + _bm_params.set_put_passes(atoi(optarg)); break; case LONGOPT_UPDATE_PASSES: - _bm_params.set_update_passes(atoi(opt_argument)); + _bm_params.set_update_passes(atoi(optarg)); break; case LONGOPT_REMOVE_PASSES: - _bm_params.set_remove_passes(atoi(opt_argument)); + _bm_params.set_remove_passes(atoi(optarg)); break; case LONGOPT_RESPONSE_THREADS: - _bm_params.set_response_threads(atoi(opt_argument)); + _bm_params.set_response_threads(atoi(optarg)); break; case LONGOPT_RPC_EVENTS_BEFORE_WAKEUP: - _bm_params.set_rpc_events_before_wakeup(atoi(opt_argument)); + _bm_params.set_rpc_events_before_wakeup(atoi(optarg)); break; case LONGOPT_RPC_NETWORK_THREADS: - _bm_params.set_rpc_network_threads(atoi(opt_argument)); + _bm_params.set_rpc_network_threads(atoi(optarg)); break; case LONGOPT_RPC_TARGETS_PER_NODE: - _bm_params.set_rpc_targets_per_node(atoi(opt_argument)); + _bm_params.set_rpc_targets_per_node(atoi(optarg)); break; case LONGOPT_SKIP_COMMUNICATIONMANAGER_THREAD: _bm_params.set_skip_communicationmanager_thread(true); |