From: Michael Tremer Date: Mon, 24 Mar 2025 16:53:42 +0000 (+0000) Subject: jail: Flush any output after we have updated the buffers X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78c472fe5d9f520f0bf126710b79d477798a5f73;p=pakfire.git jail: Flush any output after we have updated the buffers Signed-off-by: Michael Tremer --- 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) {