From: Michael Tremer Date: Wed, 23 Oct 2024 10:38:39 +0000 (+0000) Subject: jail: Return the correct return code on errors X-Git-Tag: 0.9.30~934 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b147123de5a22ce3ef25655bc042c4d85eb71137;p=pakfire.git jail: Return the correct return code on errors Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/jail.c b/src/libpakfire/jail.c index bfca392a6..b17ac7bfa 100644 --- a/src/libpakfire/jail.c +++ b/src/libpakfire/jail.c @@ -1525,6 +1525,9 @@ static int __pakfire_jail_exec(struct pakfire_jail* jail, if (output) *output = pakfire_pty_output(ctx.pty, output_length); + // Return the exit code + r = ctx.exit; + ERROR: // Destroy the temporary cgroup (if any) if (ctx.cgroup) { @@ -1556,7 +1559,7 @@ ERROR: if (ctx.loop) sd_event_unref(ctx.loop); - return ctx.exit; + return r; } int pakfire_jail_exec(struct pakfire_jail* jail, const char* argv[], int flags) {