]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
kv/MemDB: fix wrong output stream of error message
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 20 Jul 2016 05:40:09 +0000 (13:40 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 20 Jul 2016 05:40:09 +0000 (13:40 +0800)
The origin logic choose the wrong target and has no effect.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/kv/MemDB.cc

index 49205e40a2788ec731ffcc48a9a1aeba52f5f154..ed3483ef999ae952867e255a88ad33f266fd4f50 100644 (file)
@@ -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;
   }