[various] Improve documentation

Output file must be preallocated.
This commit is contained in:
Joe Thornber
2016-07-11 14:53:03 +01:00
parent ceffa5f5c4
commit 4779fb9b80
16 changed files with 127 additions and 13 deletions

View File

@@ -22,8 +22,11 @@ persistent_data::get_nr_blocks(string const &path, block_address block_size)
block_address nr_blocks;
int r = ::stat(path.c_str(), &info);
if (r)
throw runtime_error("Couldn't stat dev path");
if (r) {
ostringstream out;
out << "Couldn't stat dev path '" << path << "'";
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);