]> git.ipfire.org Git - thirdparty/util-linux.git/commit
partx: exit with error code when partition read failed
authorAndreas Henriksson <andreas@fatal.se>
Sun, 17 Jun 2018 12:49:15 +0000 (14:49 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 18 Jun 2018 08:42:36 +0000 (10:42 +0200)
commitaeda8dc3d0a5ffbdca0be1e97a7ae3008cc62a6b
tree070339399d888e9307740041bb129f51c7ddd6c6
parente60b6df54e27cdb68a75ea8a056a70f60df8f025
partx: exit with error code when partition read failed

Make sure partx exits with a non-0 return code when
it runs into either code-path where getting the partition
table failed (or wasn't even attempted because of previous
error condition).

Change was tested using:
touch /tmp/foobar
partx -s - /tmp/foobar

Previously that was only printing an error/warning message
and then exiting with 0, but after this change it exits
with 1.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Reported-by: Juan Céspedes <cespedes@debian.org>
Addresses: https://bugs.debian.org/898426
disk-utils/partx.c