The QMP client always passes either 0 or a negative errno; the != 0 check
flagged values that cannot occur. Switch to the < 0 idiom used elsewhere
in the tree, and reorder on_qmp_simple_complete so the error path is the
first branch (the more conventional shape for callbacks). Equivalent in
behaviour.
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
assert(client);
- if (error == 0)
- (void) sd_varlink_reply(link, NULL);
- else
+ if (error < 0)
(void) qmp_error_to_varlink(link, error_desc, error);
+ else
+ (void) sd_varlink_reply(link, NULL);
sd_varlink_unref(link);
return 0;
assert(client);
- if (error != 0) {
+ if (error < 0) {
(void) qmp_error_to_varlink(link, error_desc, error);
return 0;
}