]> git.ipfire.org Git - pakfire.git/commitdiff
jail: Flush any output after we have updated the buffers
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 24 Mar 2025 16:53:42 +0000 (16:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 24 Mar 2025 16:53:42 +0000 (16:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/jail.c

index 1fb05d872921c13af0a51fff6161aeb388ddf137..65ea4125d8b88ef664e1c789394557198060760e 100644 (file)
@@ -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) {