]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
xentrace: close output file in the function which opened it
authorOlaf Hering <olaf@aepfle.de>
Wed, 31 May 2023 16:06:58 +0000 (17:06 +0100)
committerGeorge Dunlap <george.dunlap@cloud.com>
Wed, 31 May 2023 16:06:58 +0000 (17:06 +0100)
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: George Dunlap <george.dunlap@cloud.com>
tools/xentrace/xentrace.c

index a073cab26d61a5bc023346d044b21474e861d370..3548255123b8fd9b1e85d240fa22c673fb7adee0 100644 (file)
@@ -794,7 +794,6 @@ static void monitor_tbufs(void)
     free(meta);
     free(data);
     /* don't need to munmap - cleanup is automatic */
-    close(outfd);
 }
 
 
@@ -1225,6 +1224,7 @@ int main(int argc, char **argv)
 
     monitor_tbufs();
 
+    close(outfd);
     return 0;
 }