[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 3/3] logging: fix endless loop on EOF



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

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy virtuozzo com>
---
 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]