From: Michael Tremer Date: Sat, 16 Dec 2023 13:07:00 +0000 (+0000) Subject: jail: Only try to restore file descriptors if they are still open X-Git-Tag: 0.9.30~1281 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ac38d6666f5d7eaa5d69a0ce1fc4b04f15fe3fb;p=pakfire.git jail: Only try to restore file descriptors if they are still open Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/jail.c b/src/libpakfire/jail.c index 7f67d080a..c26b3d09b 100644 --- a/src/libpakfire/jail.c +++ b/src/libpakfire/jail.c @@ -1251,8 +1251,10 @@ ERROR: close(timerfd); // Restore any changed terminal attributes - pakfire_jail_restore_attrs(jail, &ctx->pty.stdin); - pakfire_jail_restore_attrs(jail, &ctx->pty.stdout); + if (ctx->pty.stdin.fd >= 0) + pakfire_jail_restore_attrs(jail, &ctx->pty.stdin); + if (ctx->pty.stdout.fd >= 0) + pakfire_jail_restore_attrs(jail, &ctx->pty.stdout); return r; }