]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
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)
committerWei Liu <wei.liu2@citrix.com>
Tue, 15 Mar 2016 16:32:32 +0000 (16:32 +0000)
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;