Improve error message when opening file for truncation (#4454)

Summary:
The old error message was misleading because it led people to believe the truncation operation failed.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4454

Differential Revision: D10203575

Pulled By: riversand963

fbshipit-source-id: c76482a132566635cb55d4c73d45c461f295ec43
This commit is contained in:
Yanqin Jin 2018-10-04 14:51:44 -07:00 committed by Facebook Github Bot
parent ce1fc5af09
commit b41b2d431e

View File

@ -33,8 +33,8 @@ Status Truncate(Env* env, const std::string& filename, uint64_t length) {
const EnvOptions options;
Status s = env->NewSequentialFile(filename, &orig_file, options);
if (!s.ok()) {
fprintf(stderr, "Cannot truncate file %s: %s\n", filename.c_str(),
s.ToString().c_str());
fprintf(stderr, "Cannot open file %s for truncation: %s\n",
filename.c_str(), s.ToString().c_str());
return s;
}