ceph: propagate do_command()'s return value to user space

We were returning '1' regardless of what do_command() returned in case
of error.  This would make building tools relying on command error codes
short of useless, and forced them to rely instead on error messages.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit e91405d540)
This commit is contained in:
Joao Eduardo Luis 2013-03-28 02:07:18 +00:00 committed by Sage Weil
parent 807487c681
commit 06a1e9c0ec

View File

@ -337,8 +337,9 @@ int main(int argc, const char **argv)
}
bufferlist obl;
if (do_command(ctx, cmd, indata, obl) < 0) {
ret = 1;
ret = do_command(ctx, cmd, indata, obl);
if (ret < 0) {
ret = -ret;
break;
}
outbl.claim(obl);