summaryrefslogtreecommitdiffstats
path: root/sys-utils/ipcmk.c
diff options
context:
space:
mode:
authorKarel Zak2011-08-16 13:34:22 +0200
committerKarel Zak2011-08-16 13:34:42 +0200
commitfe931e05bcf3089f786c12a68dd017f13296a0a0 (patch)
treee1a15fb8390f67dcdbdfd35b918587f3a1baf5d5 /sys-utils/ipcmk.c
parentldattach: cleanup usage() (diff)
downloadkernel-qcow2-util-linux-fe931e05bcf3089f786c12a68dd017f13296a0a0.tar.gz
kernel-qcow2-util-linux-fe931e05bcf3089f786c12a68dd017f13296a0a0.tar.xz
kernel-qcow2-util-linux-fe931e05bcf3089f786c12a68dd017f13296a0a0.zip
ipcmk: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/ipcmk.c')
-rw-r--r--sys-utils/ipcmk.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sys-utils/ipcmk.c b/sys-utils/ipcmk.c
index 26bf8f6bc..5999f0f1c 100644
--- a/sys-utils/ipcmk.c
+++ b/sys-utils/ipcmk.c
@@ -81,13 +81,19 @@ int createSem(int nsems, int permission)
void usage(int rc)
{
- printf(_("\nUsage: %s [options]\n\n"), progname);
- printf(_(
- " -M <size> create shared memory segment of size <size>\n"
- " -S <nsems> create semaphore array with <nsems> elements\n"
- " -Q create message queue\n"
- " -p <mode> permission for the resource (default is 0644)\n"));
- printf(_("\nFor more information see ipcmk(1).\n\n"));
+ FILE *out = rc == EXIT_FAILURE ? stderr : stdout;
+
+ fputs(_("\nUsage:\n"), out);
+ fprintf(out,
+ _(" %s [options]\n"), progname);
+
+ fputs(_("\nOptions:\n"), out);
+ fputs(_(" -M <size> create shared memory segment of size <size>\n"
+ " -S <nsems> create semaphore array with <nsems> elements\n"
+ " -Q create message queue\n"
+ " -p <mode> permission for the resource (default is 0644)\n"), out);
+
+ fputs(_("\nFor more information see ipcmk(1).\n"), out);
exit(rc);
}