From 3c3b78f113aeef2401a4048d8693bb1bd8c2f4a0 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 20 Jul 2016 13:40:09 +0800 Subject: [PATCH] kv/MemDB: fix wrong output stream of error message The origin logic choose the wrong target and has no effect. Signed-off-by: xie xingguo --- src/kv/MemDB.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/kv/MemDB.cc b/src/kv/MemDB.cc index 49205e40a27..ed3483ef999 100644 --- a/src/kv/MemDB.cc +++ b/src/kv/MemDB.cc @@ -96,9 +96,8 @@ void MemDB::_load() int fd = TEMP_FAILURE_RETRY(::open(_get_data_fn().c_str(), O_RDONLY)); if (fd < 0) { int err = errno; - std::ostringstream oss; - oss << "can't open " << _get_data_fn().c_str() << ": " - << cpp_strerror(err) << std::endl; + cerr << "can't open " << _get_data_fn().c_str() << ": " + << cpp_strerror(err) << std::endl; return; } @@ -106,9 +105,8 @@ void MemDB::_load() memset(&st, 0, sizeof(st)); if (::fstat(fd, &st) < 0) { int err = errno; - std::ostringstream oss; - oss << "can't stat file " << _get_data_fn().c_str() << ": " - << cpp_strerror(err) << std::endl; + cerr << "can't stat file " << _get_data_fn().c_str() << ": " + << cpp_strerror(err) << std::endl; VOID_TEMP_FAILURE_RETRY(::close(fd)); return; } -- 2.39.5