]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMap: clear setprecision in print_osd_line
authorSamuel Just <sam.just@inktank.com>
Tue, 25 Sep 2012 20:46:32 +0000 (13:46 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 25 Sep 2012 21:09:28 +0000 (14:09 -0700)
CID 727987: Not restoring ostream format (STREAM_FORMAT_STATE)At (5): Changing
format state of stream "out" for category precision without later restoring it.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/OSDMap.cc

index e199623398931129f039646d65c6f33f0f3e78e3..a8e536ea26e18ed78fd5fff9ebbda9cd4ee30662 100644 (file)
@@ -1438,7 +1438,11 @@ void OSDMap::print_osd_line(int cur, ostream& out) const
       out << "up\t";
     else
       out << "down\t";
-    out << std::setprecision(4) << (exists(cur) ? get_weightf(cur) : 0) << "\t";
+    std::streamsize p = out.precision();
+    out << std::setprecision(4) 
+       << (exists(cur) ? get_weightf(cur) : 0)
+       << std::setprecision(p)
+       << "\t";
   }
 }