From: Sage Weil Date: Tue, 2 Jul 2019 18:20:06 +0000 (-0500) Subject: common/blkdev: include stdout and stderr on join error X-Git-Tag: v15.1.0~2266^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cff30ce6661bec5a1e046423e6335ec49471966a;p=ceph.git common/blkdev: include stdout and stderr on join error Signed-off-by: Sage Weil --- diff --git a/src/common/blkdev.cc b/src/common/blkdev.cc index 72e57d6aa2f3..3b4ab16dad9c 100644 --- a/src/common/blkdev.cc +++ b/src/common/blkdev.cc @@ -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; }