[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 1/3] xentrace: allow xentrace to write to stdout
- To: xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Olaf Hering <olaf@xxxxxxxxx>
- Date: Fri, 26 May 2023 09:29:14 +0200
- Arc-authentication-results: i=1; strato.com; arc=none; dkim=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1685086171; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=xlUaEBLrDwvOI31K8HyKZ+e2YJX5bW2ka7iFu75oZV0=; b=TolnBD0bn9B5uc4F/hAEjsr97WdpDc6OznbUV6sa/ETcmvT2Ew30QWcBM6m0drjvKi bdILLfCWmbS5Fojjxy/kNtGxGF/OTa4oKwpR7pJ1Vzib0acmnPpOnNYSpp79RoWBeW7D in45eGYsUiRo+Bq5MHl3IWFqiZeQDkM22osTZvPKnEXCvk60bWDmdNfXW+TNKCigvTR3 6JU30d6jz7arS8VL5tr4OCI9PxSq7AQlIXJRQZu9uJCv11rHnwS2yb3dH/pLSMoJ8ym0 IojFsGIy3apHCEaijSBmoV+z7NPAwJZO7qgvfoDlM/1EVX57/QbaGn8/W2rd8mH+LVB/ nWgA==
- Arc-seal: i=1; a=rsa-sha256; t=1685086171; cv=none; d=strato.com; s=strato-dkim-0002; b=H/D+yzWwuRwNmOJCusUnT3mbUQFvhvq4V4befm3R/bj1yR8Iw5A7gv9CTBDnBS1yVJ AD0TR2a3h/AJqqKmsLz3VjdLSvulHRzRRliCu5ZLlR+mCjreC6dOITwOz190XPO9/8F+ +YxJ8dHgPrkuGr3oqfAyzJTbUaH6V6uXaQKQ+DU1CGtE3CGrx9yBhcqt/LdZXUHoJHXB yatqjrcgmmTY8hwySxNgS1PoNp+WhVIUPGPLycu+ma+igzsZ8ipwZmWBcr6wgSGHxRTR 7DntscX9NjZmRhpA4EU3yQoMUpynTmAQdm95ur8PxMJ9aYoPUFU5cKeALcPHKI2sRqPy Lbbw==
- Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Delivery-date: Fri, 26 May 2023 07:29:42 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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>
---
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 */
|