int MonitorStore::umount()
{
- ::close(lock_fd);
+ int close_err = TEMP_FAILURE_RETRY(::close(lock_fd));
+ assert (0 == close_err);
return 0;
}
derr << "MonitorStore::mkfs: unable to open " << dir << ": " << cpp_strerror(err) << dendl;
return err;
}
- ::close(fd);
+ int close_err = TEMP_FAILURE_RETRY(::close(fd));
+ assert (0 == close_err);
dout(0) << "created monfs at " << dir << " for "
<< g_conf->name.get_id() << dendl;
if (r < 0) {
derr << "MonitorStore::get_int: failed to read '" << fn << "': "
<< cpp_strerror(r) << dendl;
- TEMP_FAILURE_RETRY(::close(fd));
+ int close_err = TEMP_FAILURE_RETRY(::close(fd));
+ assert(0 == close_err);
return 0;
}
- TEMP_FAILURE_RETRY(::close(fd));
+ int close_err = TEMP_FAILURE_RETRY(::close(fd));
+ assert (0 == close_err);
version_t val = atoi(buf);
off += r;
}
bl.append(bp);
- ::close(fd);
+ int close_err = TEMP_FAILURE_RETRY(::close(fd));
+ assert (0 == close_err);
if (b) {
dout(15) << "get_bl " << a << "/" << b << " = " << bl.length() << " bytes" << dendl;
if (!err)
err = ::fsync(fd);
- ::close(fd);
+ int close_err = TEMP_FAILURE_RETRY(::close(fd));
+ assert (0 == close_err); // this really can't fail, right? right?...
if (!append && !err) {
int r = ::rename(tfn, fn);
if (r < 0) {
map<version_t,version_t> *gvmap)
{
int err = 0;
+ int close_err = 0;
version_t first = start->first;
map<version_t,bufferlist>::iterator lastp = end;
--lastp;
}
err = p->second.write_fd(fd);
- ::close(fd);
+ close_err = TEMP_FAILURE_RETRY(::close(fd));
+ assert (0 == close_err);
if (err < 0)
return -errno;
return err;
}
sync_filesystem(dirfd);
- ::close(dirfd);
+ close_err = TEMP_FAILURE_RETRY(::close(dirfd));
+ assert (0 == close_err);
// rename them all into place
for (map<version_t,bufferlist>::iterator p = start; p != end; ++p) {
<< ": " << cpp_strerror(err) << dendl;
return err;
}
- ::close(dirfd);
+ close_err = TEMP_FAILURE_RETRY(::close(dirfd));
+ assert (0 == close_err);
return 0;
}
return;
}
sync_filesystem(dirfd);
- ::close(dirfd);
+ int close_err = TEMP_FAILURE_RETRY(::close(dirfd));
+ assert (0 == close_err);
}