Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
int r = -EINVAL;
if (events & EPOLLIN) {
- for (;;) {
- // Fill the buffer
- r = pakfire_log_stream_fill_buffer(stream, fd);
- if (r < 0) {
- switch (-r) {
- case EAGAIN:
- return 0;
-
- default:
- return r;
- }
- }
-
- // Drain the buffer
- r = pakfire_log_stream_drain_buffer(stream);
- if (r < 0)
- return r;
- }
+ // Fill the buffer
+ r = pakfire_log_stream_fill_buffer(stream, fd);
+ if (r < 0)
+ return r;
+
+ // Drain the buffer
+ r = pakfire_log_stream_drain_buffer(stream);
+ if (r < 0)
+ return r;
}
// Handle if the child process has closed the file descriptor