CID 716864: Unchecked return value (CHECKED_RETURN)
At (155): Calling function "ceph::buffer::list::read_file(char const *, std::string *)" without checking return value (as is done elsewhere 14 out of 16 times).
Signed-off-by: Sage Weil <sage@inktank.com>
f << fn << "/" << i;
bufferlist bl;
string error, s = f.str();
- bl.read_file(s.c_str(), &error);
+ int r = bl.read_file(s.c_str(), &error);
+ if (r < 0) {
+ cerr << "unable to read " << s << ": " << cpp_strerror(r) << std::endl;
+ exit(1);
+ }
cout << s << " got " << bl.length() << " bytes" << std::endl;
OSDMap *o = new OSDMap;
o->decode(bl);