[PATCH v3 5/5] logging: use the log cleaner

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

 



Actually use the log cleaner introduced by previous commit.

Signed-off-by: Oleg Vasilev <oleg.vasilev@xxxxxxxxxxxxx>
---
 src/logging/log_handler.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index 8fc7e9b2a8..a739211c7c 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -21,6 +21,7 @@
 #include <config.h>
 
 #include "log_handler.h"
+#include "log_cleaner.h"
 #include "virerror.h"
 #include "virfile.h"
 #include "viralloc.h"
@@ -175,7 +176,15 @@ virLogHandlerNew(bool privileged,
     handler->inhibitor = inhibitor;
     handler->opaque = opaque;
 
+    if (virLogCleanerInit(handler) < 0) {
+        goto error;
+    }
+
     return handler;
+
+ error:
+    virObjectUnref(handler);
+    return NULL;
 }
 
 
@@ -313,6 +322,8 @@ virLogHandlerDispose(void *obj)
     virLogHandler *handler = obj;
     size_t i;
 
+    virLogCleanerShutdown(handler);
+
     for (i = 0; i < handler->nfiles; i++) {
         handler->inhibitor(false, handler->opaque);
         virLogHandlerLogFileFree(handler->files[i]);
-- 
2.39.1




[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]

  Powered by Linux