From: Michael Tremer Date: Sat, 12 Oct 2024 16:43:45 +0000 (+0000) Subject: pty: Consider ourselves drained if the master fd is closed X-Git-Tag: 0.9.30~1067 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab1f73d44272413134e283bb641caff725e02e9d;p=pakfire.git pty: Consider ourselves drained if the master fd is closed Signed-off-by: Michael Tremer --- 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) {