From 5ef1320a7bac1ee929c4a54e70659bd8a33c5226 Mon Sep 17 00:00:00 2001 From: Peter Oberparleiter Date: Fri, 24 Aug 2018 09:47:41 +0100 Subject: [PATCH] iucvconn/iucvtty: Direct --help output to stdout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both iucvconn and iucvtty write output for --help to stderr. To be consistent with other s390-tools and GNU coding guide lines, fix this by using stdout for tool-generated usage help. Reviewed-by: Hendrik Brueckner Signed-off-by: Peter Oberparleiter Signed-off-by: Jan Höppner --- iucvterm/src/getopt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iucvterm/src/getopt.c b/iucvterm/src/getopt.c index b79b6a93..31863473 100644 --- a/iucvterm/src/getopt.c +++ b/iucvterm/src/getopt.c @@ -75,9 +75,11 @@ static const struct tool_info iucv_tool[2] = { static void __noreturn usage_exit(const struct tool_info *prg, int is_error, const char *msg) { + FILE *file = is_error ? stderr : stdout; + if (msg != NULL) - fprintf(stderr, _("%s: %s\n"), prg->name, msg); - fprintf(stderr, _(prg->usage), prg->name, prg->name); + fprintf(file, _("%s: %s\n"), prg->name, msg); + fprintf(file, _(prg->usage), prg->name, prg->name); exit(is_error ? 1 : 0); /* rc=1 .. invalid args */ }