]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: fix pedantic gcc warning on writing stdout
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 4 Feb 2011 12:37:53 +0000 (04:37 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 4 Feb 2011 12:39:14 +0000 (04:39 -0800)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/rados.cc

index a8034a5fe4d24063f24e3e0263ea1fb47ff56ae4..93ca4d0720d715636cddd98ecbc8df275584a8aa 100644 (file)
@@ -333,7 +333,10 @@ int main(int argc, const char **argv)
     }
 
     if (strcmp(nargs[2], "-") == 0) {
-      ::write(1, outdata.c_str(), outdata.length());
+      if (::write(1, outdata.c_str(), outdata.length()) < 0) {
+       int err = errno;
+       cerr << "error writing to stdout: error " << err << std::endl;
+      }
     } else {
       outdata.write_file(nargs[2]);
       generic_dout(0) << "wrote " << outdata.length() << " byte payload to " << nargs[2] << dendl;