]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xentrace: allow xentrace to write to stdout
authorGeorge Dunlap <george.dunlap@cloud.com>
Wed, 31 May 2023 16:06:55 +0000 (17:06 +0100)
committerGeorge Dunlap <george.dunlap@cloud.com>
Wed, 31 May 2023 16:06:55 +0000 (17:06 +0100)
The output file is optional. In case it is missing, xentrace is supposed
to write to stdout - unless it is a tty, which is checked prior using it.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: George Dunlap <george.dunlap@cloud.com>
tools/xentrace/xentrace.c

index 864e30d50cc3ef52a3f889e2edc6ac724774903c..b81abe8a51408b214399f64711f5bfd86a388f76 100644 (file)
@@ -1152,11 +1152,9 @@ static void parse_args(int argc, char **argv)
         }
     }
 
-    /* get outfile (required last argument) */
-    if (optind != (argc-1))
-        usage();
-
-    opts.outfile = argv[optind];
+    /* get outfile (optional last argument) */
+    if (argc > optind)
+        opts.outfile = argv[optind];
 }
 
 /* *BSD has no O_LARGEFILE */