* '170622' of github.com:jwpi/util-linux:
Docs: move option naming to howto-contribute.txt
Docs: update howto-usage-function.txt
Docs: add a comment for constants to boilerplate.c
include/c.h: add USAGE_COMMANDS and USAGE_COLUMNS
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>
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>
Also cleanup usage() function, never write usage to stderr.
FIXME:
- currently strtou32_or_err() exits with wrong exit code.
- option -C does not use a safe strto*_err function
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
In same go fix error reporting when input file is not long enough.
$ touch empty
$ isosize empty
isosize: empty: might not be an ISO filesystem
isosize: read error on empty: Success
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
(Original patch and commit message edited by Rudi.)
gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra.
This warning can be silenced by using comment /* fallthrough */
which is also recognized by other tools like coverity. There are
also other valid comments (see man gcc-7) but we consolidate this
style now.
We could have also used __attribute__((fallthrough)) but the comment
looks nice and does not need to be ifdef'ed for compatibility.
Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652
Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
Reviewed-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Suggested-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
disk-utils/fsck.minix.c:421:30: runtime error: index 513 out of bounds for
type 'unsigned short [512]'
Addresses: https://github.com/karelzak/util-linux/issues/373
Reported-by: Hanno Bock <hanno@gentoo.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The wipe operation is potentially dangerous. Let's inform about it
always by 'p' (list) command to make sure user knowns about it.
Command (m for help): p
...
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 204799 202752 99M 83 Linux
Filesystem/RAID signature on partition 1 will be wiped.
Addresses: https://github.com/karelzak/util-linux/issues/437
Signed-off-by: Karel Zak <kzak@redhat.com>
fdformat:
Add --from, --to, and --repair options.
Commit: e0402441a1
fdisk:
Add --output [1], --bytes [2], --wipe [3], --wipe-partition [4], and
remove --geom- from from --cylinders, --heads, --sector options [5].
Commit [1]: fff8ad5882
Commit [2]: 354f8cc8cf
Commit [3]: cb9a4b0033
Commit [4]: ba465623d8
Commit [5]: 4b4e391a28
fsck.cramfs:
Broken since first commit.
Commit: bf60993cf2
mkswap:
Provide random uuid when completing --uuid argument.
partx:
Add --sector-size option. Fix also list of known partition types to
match with libblkid blkid_idinfo names. The fix is also applied to
manual page.
Commit: f8a4a0d4f2
Reference: git grep -A 4 blkid_idinfo libblkid/src/partitions | grep name
sfdisk:
Add --reoder, --delete, --mode-dataa, -no-tell-kernel, --wipe, and
--wipe-partitions options. In same go fix some option argument
completions.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Adding _FUNCTION_DEF definition will exclude compatibility type definitions
that do include void key word in empty argument list.
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function
declaration of function 'Function'
These functions has been replaced by set of new ones in readline 4.2 (April
2001), and removed in 6.3 (February 2014).
Reference: https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES
Rererence: https://blueslugs.com/blog/2016-10-23-updating-cppfunction-in-old-readline-consumers/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
disk-utils/cfdisk.c:1066:29: error: cannot size expression
One should use sizeof() only when variable size can be known at time of
compilation. That is not the case with variable length arrays.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
/dev/sdc is 4K disk:
# fdisk -l /dev/sdc
Disk /dev/sdc: 100 MiB, 104857600 bytes, 25600 sectors
...
Device Boot Start End Sectors Size Id Type
/dev/sdc1 1024 25599 24576 96M 83 Linux
let's use it as disk image:
# dd if=/dev/sdc of=~/sdc.img
# losetup -f ~/sdc.img
old version:
# partx --show /dev/loop0
NR START END SECTORS SIZE NAME UUID
1 1024 25599 24576 12M 6a4ba75b-01
new version:
# partx --show /dev/loop0 --sector-size 4096
NR START END SECTORS SIZE NAME UUID
1 8192 204799 196608 96M 6a4ba75b-01
Addresses: https://github.com/karelzak/util-linux/issues/396
Signed-off-by: Karel Zak <kzak@redhat.com>
ninodes in the superblock needs to be set after inodes is checked
against MINIX_MAX_INODES otherwise a value larger than MINIX_MAX_INODES
can be attempted to be stored in the superblock.
Without this change the command "mkfs.minix -2 -i 65530 <dev>" would
write a minix superblock with ninodes set to 0.
Signed-off-by: Nate Clark <nate@neworld.us>