Merge branch 'heinz-changes' of github.com:jthornber/thin-provisioning-tools into rhel6.3-maintenance
This commit is contained in:
commit
21405ab76f
@ -65,8 +65,8 @@ namespace {
|
||||
if (r)
|
||||
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);
|
||||
if (S_ISREG(info.st_mode) && info.st_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
|
||||
|
@ -41,7 +41,7 @@ namespace {
|
||||
}
|
||||
} catch (std::exception &e) {
|
||||
if (!quiet)
|
||||
cerr << e.what();
|
||||
cerr << e.what() << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user