]> git.ipfire.org Git - pakfire.git/commitdiff
jail: Return the correct return code on errors
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Oct 2024 10:38:39 +0000 (10:38 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Oct 2024 10:38:39 +0000 (10:38 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/jail.c

index bfca392a656ec78d442cebede9dd7ca5a47cc2f9..b17ac7bfa5dd8777870230c36dbd7306b478946f 100644 (file)
@@ -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) {