]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/tools/ceph_monstore_tool.cc
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / tools / ceph_monstore_tool.cc
index d7169582b3338c786a711ab3c15ad5aa03a2e1e2..de26e8aedadb5d8e88910911a95fbc24485e794f 100644 (file)
@@ -43,7 +43,7 @@ class TraceIter {
   MonitorDBStore::TransactionRef t;
 public:
   explicit TraceIter(string fname) : fd(-1), idx(-1) {
-    fd = ::open(fname.c_str(), O_RDONLY);
+    fd = ::open(fname.c_str(), O_RDONLY|O_BINARY);
     t.reset(new MonitorDBStore::Transaction);
   }
   bool valid() {
@@ -879,7 +879,7 @@ int main(int argc, char **argv) {
 
     int fd = STDOUT_FILENO;
     if (!outpath.empty()){
-      fd = ::open(outpath.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666);
+      fd = ::open(outpath.c_str(), O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0666);
       if (fd < 0) {
         std::cerr << "error opening output file: "
           << cpp_strerror(errno) << std::endl;
@@ -952,7 +952,7 @@ int main(int argc, char **argv) {
         }
       } catch (const buffer::error &err) {
         std::cerr << "Could not decode for human readable output (you may still"
-                     " use non-readable mode).  Detail: " << err << std::endl;
+         " use non-readable mode).  Detail: " << err.what() << std::endl;
       }
 
       out.append(ss);