Colin Watson wrote: > * bootstrap.conf (gnulib_modules): Add xstrtoll. > * configure.ac: Create DYNAMIC_LOADING output variable. > * libparted/arch/linux.c (_device_get_length): Return the value of > PARTED_TEST_DEVICE_LENGTH if set in the environment, strictly for use by > the test suite. > (init_generic): If geometry probing fails because the device was > zero-length, return quietly rather than throwing an exception. This has > been observed in the wild with cciss devices, and it's difficult for > partitioners to tell the difference between that and more serious > errors. > * libparted/tests/Makefile.am (TESTS): Add t2100-zerolen.sh. > (check_PROGRAMS): Add zerolen. > (zerolen_SOURCES): Add. > (TESTS_ENVIRONMENT): Add DYNAMIC_LOADING and ENABLE_DEVICE_MAPPER. > * libparted/tests/t2100-zerolen.sh: New file. > * libparted/tests/zerolen.c: New file. > * tests/test-lib.sh (wait_for_dev_to_appear_): New function, copied from > tests/t-local.sh. > * NEWS (Bug fixes): Mention it. > --- > NEWS | 3 ++ > bootstrap.conf | 1 + > configure.ac | 3 ++ > libparted/arch/linux.c | 14 +++++++ > libparted/tests/Makefile.am | 9 +++-- > libparted/tests/t2100-zerolen.sh | 75 > ++++++++++++++++++++++++++++++++++++++ > libparted/tests/zerolen.c | 52 ++++++++++++++++++++++++++ > tests/test-lib.sh | 16 ++++++++ > 8 files changed, 170 insertions(+), 3 deletions(-) > create mode 100755 libparted/tests/t2100-zerolen.sh > create mode 100644 libparted/tests/zerolen.c > > diff --git a/NEWS b/NEWS > index 4979b90..65e5a69 100644 > --- a/NEWS > +++ b/NEWS > @@ -17,6 +17,9 @@ GNU parted NEWS -*- > outline -*- > an msdos partition table on a very small device (smaller than one cylinder) > is now recognized. [bug introduced in parted-2.2] > > + libparted: zero-length devices (other than files) are ignored rather than > + throwing an exception.
Thank you for the patch, and especially for the accompanying test. I've pushed that as-is. _______________________________________________ bug-parted mailing list bug-parted@gnu.org http://lists.gnu.org/mailman/listinfo/bug-parted