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
e91405d540ce11b9996e4977212553bd33afb3ed)
}
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);