From ab1f73d44272413134e283bb641caff725e02e9d Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 12 Oct 2024 16:43:45 +0000 Subject: [PATCH] pty: Consider ourselves drained if the master fd is closed Signed-off-by: Michael Tremer --- src/libpakfire/pty.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libpakfire/pty.c b/src/libpakfire/pty.c index 31986fd13..ff83cf052 100644 --- a/src/libpakfire/pty.c +++ b/src/libpakfire/pty.c @@ -274,6 +274,10 @@ static int pakfire_pty_drained(struct pakfire_pty* pty) { if (pty->master.io & PAKFIRE_PTY_READY_TO_READ) return 0; + // We are drained if the file descriptor is closed + if (pty->master.fd < 0) + return 1; + // Is there anything in the input buffer? r = ioctl(pty->master.fd, TIOCINQ, &q); if (r < 0) { -- 2.47.2