From 86be6a32d3fd229dbb17bf5e3348a01e6e6e855a Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Tue, 20 Jun 2017 20:20:29 +0200 Subject: misc: cosmetics, remove argument from usage(FILE*) This patch is trivial and changes nothing, because we were always using usage(stdout) Now all our usage() functions look very similar. If wanted we could auto-generate another big cosmetical patch to remove all the useless "FILE *out" constants and use printf and puts rather than their f* friends. Such patch could be automatically synchronized with the translation project (newlines!) to not make the translators sick. Signed-off-by: Ruediger Meier --- term-utils/script.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'term-utils/script.c') diff --git a/term-utils/script.c b/term-utils/script.c index f2fc2f59c..c59ce7b11 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -154,8 +154,9 @@ static inline time_t script_time(time_t *t) # define script_time(x) time(x) #endif -static void __attribute__((__noreturn__)) usage(FILE *out) +static void __attribute__((__noreturn__)) usage(void) { + FILE *out = stdout; fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options] [file]\n"), program_invocation_short_name); @@ -174,7 +175,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out) " -h, --help display this help and exit\n\n"), out); fprintf(out, USAGE_MAN_TAIL("script(1)")); - exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); + exit(EXIT_SUCCESS); } static void die_if_link(const struct script_control *ctl) @@ -736,7 +737,7 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); break; case 'h': - usage(stdout); + usage(); break; default: errtryhelp(EXIT_FAILURE); -- cgit v1.2.3-55-g7522