From 46dcf51ca5bc04d1b83eb8e9ae654c0e5f234dcb Mon Sep 17 00:00:00 2001 From: Mayank Agarwal Date: Fri, 30 Aug 2013 12:16:45 -0700 Subject: [PATCH] Return a '/' before names of all files through MakeFileName Summary: // won't hurt but a missing / hurts sometimes Test Plan: make all check; ./db_repl_stress Reviewers: vamsi Reviewed By: vamsi CC: dhruba Differential Revision: https://reviews.facebook.net/D12621 --- db/filename.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/db/filename.cc b/db/filename.cc index b649628a9..f47855289 100644 --- a/db/filename.cc +++ b/db/filename.cc @@ -46,13 +46,10 @@ extern Status WriteStringToFileSync(Env* env, const Slice& data, static std::string MakeFileName(const std::string& name, uint64_t number, const char* suffix) { char buf[100]; - snprintf(buf, sizeof(buf), "%06llu.%s", + snprintf(buf, sizeof(buf), "/%06llu.%s", static_cast(number), suffix); - if (name.empty()) { - return buf; - } - return name + "/" + buf; + return name + buf; } std::string LogFileName(const std::string& name, uint64_t number) {