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
This commit is contained in:
Mayank Agarwal 2013-08-30 12:16:45 -07:00
parent 59de2dbad7
commit 46dcf51ca5
1 changed files with 2 additions and 5 deletions

View File

@ -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<unsigned long long>(number),
suffix);
if (name.empty()) {
return buf;
}
return name + "/" + buf;
return name + buf;
}
std::string LogFileName(const std::string& name, uint64_t number) {