From b41b2d431e0757b5651c4ce1133de9284d9635de Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Thu, 4 Oct 2018 14:51:44 -0700 Subject: [PATCH] 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 --- util/fault_injection_test_env.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/fault_injection_test_env.cc b/util/fault_injection_test_env.cc index 3b3dbbe99..26ea0fe0e 100644 --- a/util/fault_injection_test_env.cc +++ b/util/fault_injection_test_env.cc @@ -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; }