]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ipc*: use customary fputs() instead of fprintf() with the usage macros
authorBenno Schulenberg <bensberg@justemail.net>
Wed, 24 Dec 2014 16:56:10 +0000 (17:56 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 6 Jan 2015 10:50:18 +0000 (11:50 +0100)
Also use the clearer word <number> with the --semaphore option.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
sys-utils/ipcmk.c
sys-utils/ipcrm.c
sys-utils/ipcs.c

index eae49354680d83bc1e8cb7dd81ac59653fa65caf..ff768c701a2a935f844af132b78ec22b0beea281 100644 (file)
@@ -62,7 +62,7 @@ static int create_sem(int nsems, int permission)
 
 static void __attribute__ ((__noreturn__)) usage(FILE * out)
 {
-       fprintf(out, USAGE_HEADER);
+       fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
 
        fputs(USAGE_SEPARATOR, out);
@@ -70,14 +70,15 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
 
        fputs(USAGE_OPTIONS, out);
        fputs(_(" -M, --shmem <size>       create shared memory segment of size <size>\n"), out);
-       fputs(_(" -S, --semaphore <nsems>  create semaphore array with <nsems> elements\n"), out);
+       fputs(_(" -S, --semaphore <number> create semaphore array with <number> elements\n"), out);
        fputs(_(" -Q, --queue              create message queue\n"), out);
        fputs(_(" -p, --mode <mode>        permission for the resource (default is 0644)\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("ipcmk(1)"));
+
        exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
 }
 
index 6e1f2226e354b42ada3c42fe79870a30c1318ebf..85de05a179df2e81514f15092233848bad3dd736 100644 (file)
@@ -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 <id>...\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 <id>        remove shared memory segment by id\n"), out);
        fputs(_(" -M, --shmem-key <key>      remove shared memory segment by key\n"), out);
        fputs(_(" -q, --queue-id <id>        remove message queue by id\n"), out);
@@ -62,10 +62,12 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(_(" -S, --semaphore-key <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);
 }
 
index 0542e2738fe3d4dbc5879efb635f4a58b2403a76..74d87662fce5113d4f4b34b566900c722331b020 100644 (file)
@@ -49,24 +49,26 @@ static void print_msg (int id, int unit);
 
 static void __attribute__ ((__noreturn__)) usage(FILE * out)
 {
-       fprintf(out, USAGE_HEADER);
+       fputs(USAGE_HEADER, out);
        fprintf(out, _(" %1$s [resource-option...] [output-option]\n"
                       " %1$s -m|-q|-s -i <id>\n"), program_invocation_short_name);
 
        fputs(USAGE_SEPARATOR, out);
        fputs(_("Show information on IPC facilities.\n"), out);
 
-       fprintf(out, USAGE_OPTIONS);
+       fputs(USAGE_OPTIONS, out);
        fputs(_(" -i, --id <id>  print details on resource identified by <id>\n"), out);
-       fprintf(out, USAGE_HELP);
-       fprintf(out, USAGE_VERSION);
-       fprintf(out, USAGE_SEPARATOR);
+       fputs(USAGE_HELP, out);
+       fputs(USAGE_VERSION, out);
+
+       fputs(USAGE_SEPARATOR, out);
        fputs(_("Resource options:\n"), out);
        fputs(_(" -m, --shmems      shared memory segments\n"), out);
        fputs(_(" -q, --queues      message queues\n"), out);
        fputs(_(" -s, --semaphores  semaphores\n"), out);
        fputs(_(" -a, --all         all (default)\n"), out);
-       fprintf(out, USAGE_SEPARATOR);
+
+       fputs(USAGE_SEPARATOR, out);
        fputs(_("Output options:\n"), out);
        fputs(_(" -t, --time        show attach, detach and change times\n"), out);
        fputs(_(" -p, --pid         show PIDs of creator and last operator\n"), out);
@@ -76,6 +78,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(_("     --human       show sizes in human-readable format\n"), out);
        fputs(_(" -b, --bytes       show sizes in bytes\n"), out);
        fprintf(out, USAGE_MAN_TAIL("ipcs(1)"));
+
        exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
 }