Commit Graph

43 Commits

Author SHA1 Message Date
Rosen Penev ad52498014
[clang-tidy] fix misleading identation
Found with readability-misleading-indentation

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-20 13:21:00 -07:00
Karel Zak 2c308875a7 misc: consolidate version printing and close_stdout()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 15:14:13 +02:00
Sami Kerola d52eb4bd90 tunelp: use linux header
Remove use of LPTRUSTIRQ in same go.  The LPTRUSTIRQ provided --trust-irq
option, but it has not worked in nearly 20 years.

Reference: http://repo.or.cz/davej-history.git/blobdiff/1f58336fe0515bc929e4de227eb44b12a4a18998..ac5579c68db87bc21630676c167ee8224267f32c:/include/linux/lp.h
Reference: http://repo.or.cz/davej-history.git/blobdiff/1f58336fe0515bc929e4de227eb44b12a4a18998..ac5579c68db87bc21630676c167ee8224267f32c:/drivers/char/lp.c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-07-31 13:48:04 +02:00
Ruediger Meier f45f3ec34a misc: consolidate macro style USAGE_HELP_OPTIONS
changed in include/c.h and applied via sed:

  sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c")
  sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c")

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-29 16:54:33 +02:00
Ruediger Meier b1a294c448 misc: introduce print_usage_help_options()
Consolidate --help and --version descriptions. We are
now able to align them to the other options.

We changed include/c.h. The rest of this patch was
generated by sed, plus manually setting the right
alignment numbers. We do not change anything but
white spaces in the --help output.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-27 12:26:19 +02:00
Ruediger Meier 6e1eda6f22 misc: never use usage(stderr)
Here we fix all cases where we have usage(FILE*)
functions.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-26 14:38:24 +02:00
Ruediger Meier 9c8b9fbacc lib: fix strutils.h, remove STRTOXX_EXIT_CODE
As discussed on the mailing list. We fix all places
where the non-working define STRTOXX_EXIT_CODE was used.

Regarding tunelp, also see 7e3c80a7.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-22 22:40:12 +02:00
Ruediger Meier 05691d9e88 misc: fix some broken exit codes
These tools have special exit codes. They got changed mistakenly.

See:
  findfs       0e1fa6b6
  fsck         658c0891
  fsck.cramfs  922ec175
  mkfs.cramfs  16154b1f
  tunelp       2ab428f6

FIXME: STRTOXX_EXIT_CODE doesn't work as it should.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-22 21:51:40 +02:00
Sami Kerola 8791804065 misc: do not use plain 0 as NULL [smatch scan]
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer

Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.

Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-02-20 12:58:49 +01:00
Karel Zak 677ec86cef Use --help suggestion on invalid option
The current default is to print all usage() output. This is overkill
in many case.

Addresses: https://github.com/karelzak/util-linux/issues/338
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 13:13:34 +01:00
Sami Kerola 7e5dd0e5be tunelp: use parse_switch()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-03-05 10:31:18 +01:00
Sami Kerola c45c3837b6 tunelp: remove unnecessary preprocessor directives
The lp.h included earlier in the tunelp.c has the definitions that were
checked, so these statements could have not been false and such
impossible conditions does not need to be checked.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 11:30:51 +01:00
Sami Kerola 7e3c80a7b6 tunelp: remove get_val() in favour of strtol_or_err()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 11:28:55 +01:00
Benno Schulenberg 451dbcfae1 textual: add a docstring to most of the utilities
This adds a concise description of a tool to its usage text.

A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:27:38 +01:00
Sami Kerola f627750083 textual: use version printing macro everywhere
Only mount, umount, and blkid remains not using the macro because they
are print also library references.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:23 +02:00
Sami Kerola 7d2600e2d0 docs: update deprecation banners
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:11 +02:00
Benno Schulenberg b50945d4ac textual: spell and encode the name of Arkadiusz Miśkiewicz correctly
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-02-06 11:15:02 +01:00
Benno Schulenberg 217615e8ed textual: standardize reporting of program name plus package version
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-25 11:47:29 +01:00
Karel Zak a291c7ff51 tunelp: add missing break [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-07 12:00:53 +02:00
Karel Zak 97209c2be1 tunelp: check fstat return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-21 13:11:08 +02:00
Sami Kerola efb8854f4c sys-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 19:49:40 +02:00
Dave Reisner cb493ccb66 tunelp: remove old, now unneeded header
malloc and friends are provided by stdlib.h.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-20 09:53:45 +01:00
Sami Kerola 0b077eab51 tunelp: free allocation, use xalloc
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-08 14:29:34 +01:00
Sami Kerola a21108babf tunelp: add long options and align with howto-usage-function.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-11-02 18:41:56 +01:00
Sami Kerola 915b4bacae tunelp: use libc error printing facilities
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-11-02 18:41:06 +01:00
Sami Kerola 130314aa70 tunelp: use symbolic exit values
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-11-01 21:42:20 +01:00
Sami Kerola 61319c6e3e tunelp: fix coding style
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-11-01 21:42:16 +01:00
Karel Zak 1599e6770c tunelp: fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01 13:14:21 +02:00
Davidlohr Bueso 2ab428f6a8 sys-utils: make use xalloc wrappers
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-01 16:43:23 +01:00
Benno Schulenberg e6b0611b46 messages: gettextize a few skipped or forgotten ones
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2010-06-14 11:19:19 +02:00
maximilian attems d3e8f6598b remove CVS keywords
this patch removes old CVS keywords from comments.

mount(8) works for newer Linux then 0.99 ;)

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:10:08 +02:00
Karel Zak baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
Karel Zak ffc4374869 Imported from util-linux-2.11o tarball. 2006-12-07 00:25:53 +01:00
Karel Zak c07ebfa1e0 Imported from util-linux-2.11b tarball. 2006-12-07 00:25:46 +01:00
Karel Zak 66ee8158b6 Imported from util-linux-2.10s tarball. 2006-12-07 00:25:44 +01:00
Karel Zak 22853e4a82 Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00
Karel Zak eb63b9b8f4 Imported from util-linux-2.10f tarball. 2006-12-07 00:25:41 +01:00
Karel Zak 7eda085c41 Imported from util-linux-2.9v tarball. 2006-12-07 00:25:39 +01:00
Karel Zak 2b6fc908bc Imported from util-linux-2.8 tarball. 2006-12-07 00:25:35 +01:00
Karel Zak fd6b7a7ffc Imported from util-linux-2.7.1 tarball. 2006-12-07 00:25:34 +01:00
Karel Zak 726f69e29c Imported from util-linux-2.5 tarball. 2006-12-07 00:25:33 +01:00
Karel Zak 6dbe3af945 Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00