From b147123de5a22ce3ef25655bc042c4d85eb71137 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 23 Oct 2024 10:38:39 +0000 Subject: [PATCH] jail: Return the correct return code on errors Signed-off-by: Michael Tremer --- src/libpakfire/jail.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.47.2