CID 717095: Resource leak (RESOURCE_LEAK)
At (13): Handle variable "fd" going out of scope leaks the handle.
Signed-off-by: Sage Weil <sage@inktank.com>
if (actual < 0) {
r = -errno;
dout(0) << "write lseek64 to " << offset << " failed: " << cpp_strerror(r) << dendl;
+ TEMP_FAILURE_RETRY(::close(fd));
goto out;
}
if (actual != (int64_t)offset) {
dout(0) << "write lseek64 to " << offset << " gave bad offset " << actual << dendl;
r = -EIO;
+ TEMP_FAILURE_RETRY(::close(fd));
goto out;
}