From: Christian Brauner Date: Tue, 21 Apr 2026 22:19:20 +0000 (+0200) Subject: vmspawn-varlink: use error < 0 in async QMP completion callbacks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b34413db8e462a51feff98e427268a682ce9c7f7;p=thirdparty%2Fsystemd.git vmspawn-varlink: use error < 0 in async QMP completion callbacks 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) --- diff --git a/src/vmspawn/vmspawn-varlink.c b/src/vmspawn/vmspawn-varlink.c index 98d3fc73e91..a9b64667c52 100644 --- a/src/vmspawn/vmspawn-varlink.c +++ b/src/vmspawn/vmspawn-varlink.c @@ -51,10 +51,10 @@ static int on_qmp_simple_complete( 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; @@ -118,7 +118,7 @@ static int on_qmp_describe_complete( assert(client); - if (error != 0) { + if (error < 0) { (void) qmp_error_to_varlink(link, error_desc, error); return 0; }