[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xentrace: allow xentrace to write to stdout



commit 0e0d3c00bc098e41b82a4073e3d3f5432fb9b0c6
Author:     George Dunlap <george.dunlap@xxxxxxxxx>
AuthorDate: Wed May 31 17:06:55 2023 +0100
Commit:     George Dunlap <george.dunlap@xxxxxxxxx>
CommitDate: Wed May 31 17:06:55 2023 +0100

    xentrace: allow xentrace to write to stdout
    
    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@xxxxxxxxx>
    Acked-by: George Dunlap <george.dunlap@xxxxxxxxx>
---
 tools/xentrace/xentrace.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index 864e30d50c..b81abe8a51 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -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 */
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.