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 <[email protected]> --- 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 */
