]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/blkdev: include stdout and stderr on join error
authorSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 18:20:06 +0000 (13:20 -0500)
committerSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 19:29:53 +0000 (14:29 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/blkdev.cc

index 72e57d6aa2f3c518154b3fe9080dda105c582e70..3b4ab16dad9c6603d765046d1e1a64a1105e030f 100644 (file)
@@ -700,8 +700,10 @@ static int block_device_run_smartctl(const string& devname, int timeout,
     *result = output.to_str();
   }
 
-  if (smartctl.join() != 0) {
-    *result = std::string("smartctl returned an error:") + smartctl.err();
+  int joinerr = smartctl.join();
+  if (joinerr) {
+    *result = std::string("smartctl returned an error (") + stringify(joinerr) +
+      "): stderr:\n") + smartctl.err() + "\nstdout:\n" + *result;
     return -EINVAL;
   }