summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorAndreas Henriksson2018-06-17 14:49:15 +0200
committerKarel Zak2018-06-18 10:42:36 +0200
commitaeda8dc3d0a5ffbdca0be1e97a7ae3008cc62a6b (patch)
tree070339399d888e9307740041bb129f51c7ddd6c6 /disk-utils
parentsetarch: add another PER_LINUX32 aliases for ppcle (diff)
downloadkernel-qcow2-util-linux-aeda8dc3d0a5ffbdca0be1e97a7ae3008cc62a6b.tar.gz
kernel-qcow2-util-linux-aeda8dc3d0a5ffbdca0be1e97a7ae3008cc62a6b.tar.xz
kernel-qcow2-util-linux-aeda8dc3d0a5ffbdca0be1e97a7ae3008cc62a6b.zip
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
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/partx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index 3ccd1afad..f895b9be3 100644
--- a/disk-utils/partx.c
+++ b/disk-utils/partx.c
@@ -1054,7 +1054,9 @@ int main(int argc, char **argv)
default:
abort();
}
- }
+ } else
+ rc = 1;
+
blkid_free_probe(pr);
}