From: Karel Zak Date: Wed, 18 Apr 2012 10:38:03 +0000 (+0200) Subject: swapoff: cleanup usage() and includes X-Git-Tag: v2.22-rc1~523 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cf6a6547666f5ebde51d6700198d5f66ce58c38;p=thirdparty%2Futil-linux.git swapoff: cleanup usage() and includes Signed-off-by: Karel Zak --- diff --git a/sys-utils/swapoff.c b/sys-utils/swapoff.c index 8482026a97..0bd85ac9c7 100644 --- a/sys-utils/swapoff.c +++ b/sys-utils/swapoff.c @@ -1,16 +1,6 @@ -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include #ifdef HAVE_SYS_SWAP_H # include @@ -71,16 +61,19 @@ static int swapoff_by_uuid(const char *uuid, int quiet) return special ? do_swapoff(special, quiet, CANONIC) : cannot_find(uuid); } -static void usage(FILE *out, int n) +static void __attribute__ ((__noreturn__)) usage(FILE * out) { - fputs(_("\nUsage:\n"), out); + fputs(USAGE_HEADER, out); + fprintf(out, _(" %s [options] []\n"), program_invocation_short_name); - fputs(_("\nOptions:\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -a, --all disable all swaps from /proc/swaps\n" - " -h, --help display help and exit\n" - " -v, --verbose verbose mode\n" - " -V, --version display version and exit\n"), out); + " -v, --verbose verbose mode\n"), out); + + fputs(USAGE_SEPARATOR, out); + fputs(USAGE_HELP, out); + fputs(USAGE_VERSION, out); fputs(_("\nThe parameter:\n" \ " -L