On EOF condition we always have POLLHUP event and read returns
0 thus we never break loop in virLogHandlerDomainLogFileDrain.

Signed-off-by: Nikolay Shirokovskiy <[email protected]>
---
 src/logging/log_handler.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index c04f341..152ca24 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -464,6 +464,8 @@ virLogHandlerDomainLogFileDrain(virLogHandlerLogFilePtr 
file)
             if (errno == EINTR)
                 continue;
             return;
+        } else if (len == 0) {
+            return;
         }
 
         if (virRotatingFileWriterAppend(file->file, buf, len) != len)
-- 
1.8.3.1

Reply via email to