Commit Graph

42 Commits

Author SHA1 Message Date
Ville Skyttä 3c56068609 *: spelling and grammar fixes 2020-12-17 23:39:05 +02:00
Karel Zak c135625734 fdformat: cast before lseek [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-09-20 15:45:15 +02: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
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
Jakub Wilk fc747ee72a fdformat: clear progress message before printing "done"
Before:

    Formatting ... done1

After:

    Formatting ... done

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2017-06-02 23:54:10 +02:00
Sami Kerola 2ba641e5f3 misc: add static keyword to where needed [smatch scan]
text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be
static?

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 f5320b483c
fdformat: fix block device open race
This fix makes fdformat also to detect if block device is busy, and warn if
the device is misaligned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Benno Schulenberg fc14ceba5e textual: grammarize and harmonize the stat error message
The message "stat failed %s" seems to say that stat() failed to
do something, or failed to pass a test, but of course it means
that the statting of something failed.  So say so.  Also make
two very similar messages equal to this one.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 11:27:10 +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
Karel Zak 80b037cc6f fdformat: clean up usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 13:53:26 +02:00
Jaromir Capik e0402441a1 fdformat: Add new switches -f/--from, -t/--to, -r/--repair
This commit introduces a support for user configurable
from/to track and a basic repair mode for broken floppies.
It also fixes a recently introduced bug that causes
a line breakage when printing the track number.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 13:44:04 +02:00
Sami Kerola 18b1fcb9cc fdformat: match variable and print format types
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 17:34:25 +01:00
Sami Kerola 5efee9d414 fdformat: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:06 +02:00
Karel Zak e421313dc2 textual: use UTIL_LINUX_VERSION everywhere
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-25 12:05:26 +01:00
Sami Kerola 289dcc9023 translation: unify file open error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +02:00
Sami Kerola add1b8afd0 translation: unify stat error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +02:00
Sami Kerola 45ca68ece7 disk-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 20:04:39 +02:00
Francesco Cosoleto 8c40f48195 fdformat: fix uninitialized variable
Spotted by EKOPath compiler.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2011-09-12 12:45:57 +02:00
Karel Zak 3160fcf326 fdformat: cleanup error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-18 16:57:55 +02:00
Sami Kerola 8d18d35311 fdformat: coding style
Reindent the file to match with README.devel instructions.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 18:45:37 +02:00
Sami Kerola 183feb0288 fdformat: include-what-you-use header check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 18:45:37 +02:00
Sami Kerola a53b31d0bd fdformat: use xalloc.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 18:45:37 +02:00
Sami Kerola 40c077a53d fdformat: integer comparisons & unused parameter
Fix compiler warnings about mismatching types and unused parameter.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 18:45:37 +02:00
Sami Kerola a8f364805b fdformat: use long options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 18:45:37 +02:00
Sami Kerola b7889ba895 fdformat: use libc error printing facilities
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 18:45:36 +02:00
Cristian Rodríguez 4629c03d34 fdformat: fix memory leak in verify_disk()
Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
2009-10-06 10:26:04 +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 63cccae468 Imported from util-linux-2.11t tarball. 2006-12-07 00:25:58 +01:00
Karel Zak e8f2641919 Imported from util-linux-2.11m tarball. 2006-12-07 00:25:49 +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 5c36a0eb7c Imported from util-linux-2.9i tarball. 2006-12-07 00:25:37 +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