From 7c0b5ec54a5458a7e699eb06e118f59e2137f588 Mon Sep 17 00:00:00 2001 From: Dhruba Borthakur Date: Wed, 15 Aug 2012 22:52:39 -0700 Subject: [PATCH] leveldb thrift server uses an incorrect root directory Summary: The offsets used to speficy hostname and dbdir from the command line were not handled correctly. Test Plan: none. Reviewers: heyongqiang Reviewed By: heyongqiang Differential Revision: https://reviews.facebook.net/D4683 --- thrift/server_options.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thrift/server_options.h b/thrift/server_options.h index 40a16edd1..797c9a566 100644 --- a/thrift/server_options.h +++ b/thrift/server_options.h @@ -73,10 +73,10 @@ public: cache_size_ = l; } else if (sscanf(argv[i], "--cache_numshardbits=%d%c", &n, &junk) == 1) { cache_numshardbits_ = n; - } else if (strncmp(argv[i], "--hostname=", 10) == 0) { - hostname_ = argv[i] + 10; - } else if (strncmp(argv[i], "--rootdir=", 9) == 0) { - rootdir_ = argv[i] + 9; + } else if (strncmp(argv[i], "--hostname=", 11) == 0) { + hostname_ = argv[i] + 11; + } else if (strncmp(argv[i], "--rootdir=", 10) == 0) { + rootdir_ = argv[i] + 10; } else { fprintf(stderr, "Invalid flag '%s'\n", argv[i]); return false;