summaryrefslogtreecommitdiffstats
path: root/sys-utils/ctrlaltdel.c
diff options
context:
space:
mode:
authorRuediger Meier2017-06-20 20:20:29 +0200
committerRuediger Meier2017-06-26 14:38:24 +0200
commit86be6a32d3fd229dbb17bf5e3348a01e6e6e855a (patch)
tree04f05fd94b26d2b5a6304d69e93f2ec59e789e17 /sys-utils/ctrlaltdel.c
parentmisc: cosmetics, remove argument from usage(int) (diff)
downloadkernel-qcow2-util-linux-86be6a32d3fd229dbb17bf5e3348a01e6e6e855a.tar.gz
kernel-qcow2-util-linux-86be6a32d3fd229dbb17bf5e3348a01e6e6e855a.tar.xz
kernel-qcow2-util-linux-86be6a32d3fd229dbb17bf5e3348a01e6e6e855a.zip
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 <ruediger.meier@ga-group.nl>
Diffstat (limited to 'sys-utils/ctrlaltdel.c')
-rw-r--r--sys-utils/ctrlaltdel.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys-utils/ctrlaltdel.c b/sys-utils/ctrlaltdel.c
index 840945082..98c8ed832 100644
--- a/sys-utils/ctrlaltdel.c
+++ b/sys-utils/ctrlaltdel.c
@@ -21,19 +21,20 @@
#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
{
- fprintf(out, USAGE_HEADER);
+ FILE *out = stdout;
+ fputs(USAGE_HEADER, out);
fprintf(out, _(" %s hard|soft\n"), program_invocation_short_name);
- fprintf(out, USAGE_SEPARATOR);
+ fputs(USAGE_SEPARATOR, out);
fprintf(out, _("Set the function of the Ctrl-Alt-Del combination.\n"));
- fprintf(out, USAGE_OPTIONS);
- fprintf(out, USAGE_HELP);
- fprintf(out, USAGE_VERSION);
+ fputs(USAGE_OPTIONS, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION,out);
fprintf(out, USAGE_MAN_TAIL("ctrlaltdel(8)"));
- exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
}
static int get_cad(void)
@@ -98,7 +99,7 @@ int main(int argc, char **argv)
printf(UTIL_LINUX_VERSION);
return EXIT_SUCCESS;
case 'h':
- usage(stdout);
+ usage();
default:
errtryhelp(EXIT_FAILURE);
}