[PATCH 4/6] Fix a counter bug in the log buffer

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

 



* src/util/logging.c: the start pointer need to wrap around too

Signed-off-by: Daniel Veillard <veillard@xxxxxxxxxx>
---
 src/util/logging.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/util/logging.c b/src/util/logging.c
index 33b0992..b946285 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -271,6 +271,8 @@ static void virLogStr(const char *str, int len) {
         tmp = virLogLen - LOG_BUFFER_SIZE;
         virLogLen = LOG_BUFFER_SIZE;
         virLogStart += tmp;
+        if (virLogStart >= LOG_BUFFER_SIZE)
+            virLogStart -= LOG_BUFFER_SIZE;
     }
     virLogUnlock();
 }
--
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]