Fix segfault with file argument

This commit is contained in:
Heinz Mauelshagen 2012-03-13 12:15:32 +01:00
parent 422c56c9b8
commit ba6984504e

View File

@ -66,7 +66,7 @@ namespace {
throw runtime_error("Couldn't stat dev path");
if (S_ISREG(info.st_mode))
nr_blocks = div_down<block_address>(info.st_size, MD_BLOCK_SIZE);
nr_blocks = div_up<block_address>(info.st_size, MD_BLOCK_SIZE);
else if (S_ISBLK(info.st_mode)) {
// To get the size of a block device we need to