From 7009af0e0dbce1bac5d16be89a43077badf0f897 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 24 Dec 2014 17:56:10 +0100 Subject: ipc*: use customary fputs() instead of fprintf() with the usage macros Also use the clearer word with the --semaphore option. Signed-off-by: Benno Schulenberg --- sys-utils/ipcrm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sys-utils/ipcrm.c') diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c index 6e1f2226e..85de05a17 100644 --- a/sys-utils/ipcrm.c +++ b/sys-utils/ipcrm.c @@ -46,14 +46,14 @@ static int verbose = 0; /* print the usage */ static void __attribute__ ((__noreturn__)) usage(FILE * out) { - fprintf(out, USAGE_HEADER); + fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options]\n" " %s shm|msg|sem ...\n"), program_invocation_short_name); fputs(USAGE_SEPARATOR, out); fputs(_("Remove certain IPC resources.\n"), out); - fprintf(out, USAGE_OPTIONS); + fputs(USAGE_OPTIONS, out); fputs(_(" -m, --shmem-id remove shared memory segment by id\n"), out); fputs(_(" -M, --shmem-key remove shared memory segment by key\n"), out); fputs(_(" -q, --queue-id remove message queue by id\n"), out); @@ -62,10 +62,12 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fputs(_(" -S, --semaphore-key remove semaphore by key\n"), out); fputs(_(" -a, --all[=shm|msg|sem] remove all (in the specified category)\n"), out); fputs(_(" -v, --verbose explain what is being done\n"), out); - fprintf(out, USAGE_SEPARATOR); - fprintf(out, USAGE_HELP); - fprintf(out, USAGE_VERSION); + + fputs(USAGE_SEPARATOR, out); + fputs(USAGE_HELP, out); + fputs(USAGE_VERSION, out); fprintf(out, USAGE_MAN_TAIL("ipcrm(1)")); + exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); } -- cgit v1.2.3-55-g7522