From: Karel Zak Date: Wed, 18 May 2022 08:41:00 +0000 (+0200) Subject: pipesz: fix minor coding style issues X-Git-Tag: v2.39-rc1~655 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=410b261cce8294653c03cb678f61512fa52e81e8;p=thirdparty%2Futil-linux.git pipesz: fix minor coding style issues * remove tailing white spaces * use {} for while() * fix --help indention Signed-off-by: Karel Zak --- diff --git a/misc-utils/pipesz.c b/misc-utils/pipesz.c index 76c1b1506f..db5ab34959 100644 --- a/misc-utils/pipesz.c +++ b/misc-utils/pipesz.c @@ -32,7 +32,7 @@ #include "strutils.h" /* strtos32_or_err strtosize_or_err */ static char opt_check = 0; /* --check */ -static char opt_get = 0; /* --get */ +static char opt_get = 0; /* --get */ static char opt_quiet = 0; /* --quiet */ static int opt_size = -1; /* --set */ static char opt_verbose = 0; /* --verbose */ @@ -72,9 +72,10 @@ static void __attribute__((__noreturn__)) usage(void) fputs(USAGE_OPTIONS, stdout); puts(_(" -g, --get examine pipe buffers")); /* TRANSLATORS: '%s' refers to a system file */ - printf(_(" -s, --set set pipe buffer sizes\n" - " size defaults to %s\n" - ), PIPESZ_DEFAULT_SIZE_FILE); + printf( + _(" -s, --set set pipe buffer sizes\n" + " size defaults to %s\n"), + PIPESZ_DEFAULT_SIZE_FILE); fputs(USAGE_SEPARATOR, stdout); puts(_(" -f, --file act on a file")); @@ -103,7 +104,7 @@ static void __attribute__((__noreturn__)) usage(void) static void do_get(int fd, const char *name) { int sz, used; - + sz = fcntl(fd, F_GETPIPE_SZ); if (sz < 0) { /* TRANSLATORS: '%s' refers to a file */ @@ -123,7 +124,7 @@ static void do_get(int fd, const char *name) static void do_set(int fd, const char *name) { int sz; - + sz = fcntl(fd, F_SETPIPE_SZ, opt_size); if (sz < 0) /* TRANSLATORS: '%s' refers to a file */ @@ -228,13 +229,14 @@ int main(int argc, char **argv) close_stdout_atexit(); /* check for --help or --version */ - while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) + while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (c) { case 'h': usage(); case 'V': print_version(EXIT_SUCCESS); } + } /* gather normal options */ optind = 1;