Merge branch '2016-07-07-improve-thin-repair-error-message' into v0.7-devel

Conflicts:
	Makefile.in
	VERSION
	configure.ac
	persistent-data/file_utils.cc
This commit is contained in:
Joe Thornber
2016-07-11 15:51:30 +01:00
17 changed files with 131 additions and 17 deletions

View File

@ -22,9 +22,12 @@ persistent_data::get_nr_blocks(string const &path, sector_t block_size)
block_address nr_blocks;
int r = ::stat(path.c_str(), &info);
if (r)
throw runtime_error("Couldn't stat dev path " + path + ": " +
strerror(errno));
if (r) {
ostringstream out;
out << "Couldn't stat dev path '" << path << "': "
<< strerror(errno);
throw runtime_error(out.str());
}
if (S_ISREG(info.st_mode) && info.st_size)
nr_blocks = div_down<block_address>(info.st_size, block_size);