[*_restore] Fix leaking file descriptor (#89)
This commit is contained in:
parent
1253d720e9
commit
39809c17b2
@ -151,6 +151,8 @@ file_utils::zero_superblock(std::string const &path)
|
|||||||
memset(buffer, 0, SUPERBLOCK_SIZE);
|
memset(buffer, 0, SUPERBLOCK_SIZE);
|
||||||
if (::write(fd, buffer, SUPERBLOCK_SIZE) != SUPERBLOCK_SIZE)
|
if (::write(fd, buffer, SUPERBLOCK_SIZE) != SUPERBLOCK_SIZE)
|
||||||
throw runtime_error("couldn't zero superblock");
|
throw runtime_error("couldn't zero superblock");
|
||||||
|
|
||||||
|
::close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user