diff options
author | Karel Zak | 2017-06-26 15:58:37 +0200 |
---|---|---|
committer | Karel Zak | 2017-06-26 15:58:37 +0200 |
commit | 47ccf06b4728130beb19b05a5c13a87e2807ad3e (patch) | |
tree | ca6073f0053d6e362b623d2817edcdb3ae45d93d /text-utils/colrm.c | |
parent | script: rename fixtty() to enable_rawmode_tty() (diff) | |
parent | misc: cosmetics, remove argument from usage(FILE*) (diff) | |
download | kernel-qcow2-util-linux-47ccf06b4728130beb19b05a5c13a87e2807ad3e.tar.gz kernel-qcow2-util-linux-47ccf06b4728130beb19b05a5c13a87e2807ad3e.tar.xz kernel-qcow2-util-linux-47ccf06b4728130beb19b05a5c13a87e2807ad3e.zip |
Merge branch 'usage-part2' of https://github.com/rudimeier/util-linux
* 'usage-part2' of https://github.com/rudimeier/util-linux:
misc: cosmetics, remove argument from usage(FILE*)
misc: cosmetics, remove argument from usage(int)
misc: never use usage(stderr)
misc: never use usage(ERROR)
misc: cleanup and fix --unknownopt issues
flock, getopt: write --help to stdout and return 0
tools: add checkusage.sh
Diffstat (limited to 'text-utils/colrm.c')
-rw-r--r-- | text-utils/colrm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/text-utils/colrm.c b/text-utils/colrm.c index b2816cd07..ebebca0bf 100644 --- a/text-utils/colrm.c +++ b/text-utils/colrm.c @@ -54,8 +54,9 @@ COLRM removes unwanted columns from a file Jeff Schriebman UC Berkeley 11-74 */ -static void __attribute__ ((__noreturn__)) usage(FILE * out) +static void __attribute__((__noreturn__)) usage(void) { + FILE *out = stdout; fprintf(out, _("\nUsage:\n" " %s [startcol [endcol]]\n"), program_invocation_short_name); @@ -69,7 +70,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fprintf(out, _("%s reads from standard input and writes to standard output\n\n"), program_invocation_short_name); fprintf(out, USAGE_MAN_TAIL("colrm(1)")); - exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); + exit(EXIT_SUCCESS); } static int process_input(unsigned long first, unsigned long last) @@ -176,7 +177,7 @@ int main(int argc, char **argv) printf(UTIL_LINUX_VERSION); return EXIT_SUCCESS; case 'h': - usage(stdout); + usage(); default: errtryhelp(EXIT_FAILURE); } |