fix up some coverity issues
This commit is contained in:
@@ -40,6 +40,7 @@ namespace {
|
||||
md_sm_(md_sm),
|
||||
data_sm_(data_sm),
|
||||
in_range_(false),
|
||||
time_(),
|
||||
found_errors_(false) {
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace {
|
||||
restorer(metadata::ptr md)
|
||||
: md_(md),
|
||||
in_superblock_(false),
|
||||
nr_data_blocks_(),
|
||||
empty_mapping_(new_mapping_tree()) {
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ superblock_traits::unpack(superblock_disk const &disk, superblock &value)
|
||||
value.metadata_nr_blocks_ = to_cpu<uint64_t>(disk.metadata_nr_blocks_);
|
||||
|
||||
value.compat_flags_ = to_cpu<uint32_t>(disk.compat_flags_);
|
||||
value.compat_ro_flags_ = to_cpu<uint32_t>(disk.compat_ro_flags_);
|
||||
value.incompat_flags_ = to_cpu<uint32_t>(disk.incompat_flags_);
|
||||
}
|
||||
|
||||
@@ -70,6 +71,7 @@ superblock_traits::pack(superblock const &value, superblock_disk &disk)
|
||||
disk.metadata_nr_blocks_ = to_disk<le64>(value.metadata_nr_blocks_);
|
||||
|
||||
disk.compat_flags_ = to_disk<le32>(value.compat_flags_);
|
||||
disk.compat_ro_flags_ = to_disk<le32>(value.compat_ro_flags_);
|
||||
disk.incompat_flags_ = to_disk<le32>(value.incompat_flags_);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,8 @@ namespace {
|
||||
class mapping_reporter : public mapping_tree_detail::damage_visitor {
|
||||
public:
|
||||
mapping_reporter(nested_output &out)
|
||||
: out_(out) {
|
||||
: out_(out),
|
||||
err_(NO_ERROR) {
|
||||
}
|
||||
|
||||
virtual void visit(mapping_tree_detail::missing_devices const &d) {
|
||||
|
||||
@@ -150,7 +150,14 @@ int main(int argc, char **argv)
|
||||
|
||||
case 1:
|
||||
// region
|
||||
regions.push_back(parse_region(optarg));
|
||||
try {
|
||||
regions.push_back(parse_region(optarg));
|
||||
|
||||
} catch (std::exception const &e) {
|
||||
cerr << e.what();
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user