[PATCH] virlog: Fix build breaker with "comparison between signed and unsigned"

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

 



Refactor series 0b231195 worked with virLogDestination type which, depending
on the compiler, might be (and probably will be) an unsigned data type.
However, virEnumFromString may return -1 in case of an error. So, when enum
happens to be unsigned, some compilers will naturally complain about foo:
    'if (foo < 0)'
---
I pushed the patch under build breaker rule.

 src/util/virlog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virlog.c b/src/util/virlog.c
index 591d38e..007fc65 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -1088,7 +1088,7 @@ virLogParseOutput(const char *src)
     char *abspath = NULL;
     size_t count = 0;
     virLogPriority prio;
-    virLogDestination dest;
+    int dest;
     bool isSUID = virIsSUID();
 
     if (!src)
-- 
2.4.3

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