tools/xenalyze: Fix check for error return value
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Thu, 25 Feb 2016 14:49:00 +0000 (14:49 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 29 Feb 2016 16:12:49 +0000 (11:12 -0500)
fdopen returns NULL on failure, not a negative integer.

CID 1306863
CID 1306858

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xentrace/xenalyze.c

index 33f812919b9abf7bc867cfe65a1e44bc4c5d6f1f..d071f9d23cda3c6a1a6d761130cef6add13e80d4 100644 (file)
@@ -9028,7 +9028,7 @@ void progress_init(void) {
         opt.progress = 0;
     }
 
-    if( (G.progress.out = fdopen(G.progress.pipe[1], "w")) < 0 ) {
+    if( (G.progress.out = fdopen(G.progress.pipe[1], "w")) == NULL ) {
         fprintf(stderr, "%s: could not fdopen pipe: %s, disabling progress bar\n",
                 __func__, strerror(errno));
         opt.progress = 0;