]> xenbits.xensource.com Git - libvirt.git/commitdiff
virlog: Fix build breaker with "comparison between signed and unsigned"
authorErik Skultety <eskultet@redhat.com>
Wed, 16 Mar 2016 15:22:30 +0000 (16:22 +0100)
committerErik Skultety <eskultet@redhat.com>
Wed, 16 Mar 2016 20:33:11 +0000 (21:33 +0100)
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)'

src/util/virlog.c

index 591d38e413f55dc82c162add485d6b163eb8888b..007fc65ebfa266ddb5f6c3c50ee3d4429744c235 100644 (file)
@@ -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)