From 78c472fe5d9f520f0bf126710b79d477798a5f73 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 24 Mar 2025 16:53:42 +0000 Subject: [PATCH] jail: Flush any output after we have updated the buffers Signed-off-by: Michael Tremer --- src/pakfire/jail.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pakfire/jail.c b/src/pakfire/jail.c index 1fb05d87..65ea4125 100644 --- a/src/pakfire/jail.c +++ b/src/pakfire/jail.c @@ -437,7 +437,7 @@ static int pakfire_jail_output(struct pakfire_jail* self, int fd, unsigned int e if (bytes_read < 0) { switch (errno) { case EAGAIN: - return 0; + goto END; default: return -errno; @@ -457,6 +457,12 @@ static int pakfire_jail_output(struct pakfire_jail* self, int fd, unsigned int e } } } + +END: + // Flush after we have updated the buffer + fflush(f); + + return 0; } static int pakfire_jail_stdout(sd_event_source* source, int fd, unsigned int events, void* data) { -- 2.39.5