From: Michael Tremer Date: Sun, 6 Oct 2024 14:57:44 +0000 (+0000) Subject: pty: Reset file-descriptors into blocking mode again when done X-Git-Tag: 0.9.30~1133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eca824fbaeb56abd5098c9eff7878566055b6bfe;p=pakfire.git pty: Reset file-descriptors into blocking mode again when done Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pty.c b/src/libpakfire/pty.c index 90c76dcc0..67b49e173 100644 --- a/src/libpakfire/pty.c +++ b/src/libpakfire/pty.c @@ -102,8 +102,8 @@ static int pakfire_pty_restore_attrs(struct pakfire_pty* pty, if (!isatty(stdio->fd)) return 0; - // Restore the flags - r = fcntl(stdio->fd, F_SETFL, stdio->flags); + // Restore the flags (and make the file descriptor blocking again) + r = fcntl(stdio->fd, F_SETFL, stdio->flags & ~O_NONBLOCK); if (r < 0) { CTX_ERROR(pty->ctx, "Could not set flags for file descriptor %d: %s\n", stdio->fd, strerror(errno));