[[PATCH v2] 2/4] virtlogd: stop reading on EOF instead of hangup

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

 



Otherwise we can miss log tail. Handling hangup in a special
way in not nessessary.
---
 src/logging/log_handler.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index cd0ba6e..ca294a0 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -140,7 +140,7 @@ virLogHandlerGetLogFileFromWatch(virLogHandlerPtr handler,
 static void
 virLogHandlerDomainLogFileEvent(int watch,
                                 int fd,
-                                int events,
+                                int events ATTRIBUTE_UNUSED,
                                 void *opaque)
 {
     virLogHandlerPtr handler = opaque;
@@ -167,12 +167,12 @@ virLogHandlerDomainLogFileEvent(int watch,
         goto error;
     }
 
+    if (len == 0)
+        goto error;
+
     if (virRotatingFileWriterAppend(logfile->file, buf, len) != len)
         goto error;
 
-    if (events & VIR_EVENT_HANDLE_HANGUP)
-        goto error;
-
     virObjectUnlock(handler);
     return;
 
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]