From: Andreas Henriksson Date: Sun, 17 Jun 2018 12:49:15 +0000 (+0200) Subject: partx: exit with error code when partition read failed X-Git-Tag: v2.33-rc1~206 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aeda8dc3d0a5ffbdca0be1e97a7ae3008cc62a6b;p=thirdparty%2Futil-linux.git 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 Reported-by: Juan Céspedes Addresses: https://bugs.debian.org/898426 --- diff --git a/disk-utils/partx.c b/disk-utils/partx.c index 3ccd1afadc..f895b9be31 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); }