if (fd < 0)
return -errno;
int ret = safe_read_exact(fd, buf, len);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return ret;
}
static void remove_cleanup_file(const char *file)
{
pthread_mutex_lock(&cleanup_lock);
- TEMP_FAILURE_RETRY(unlink(file));
+ VOID_TEMP_FAILURE_RETRY(unlink(file));
for (std::vector <const char*>::iterator i = cleanup_files.begin();
i != cleanup_files.end(); ++i) {
if (strcmp(file, *i) == 0) {
pthread_mutex_lock(&cleanup_lock);
for (std::vector <const char*>::iterator i = cleanup_files.begin();
i != cleanup_files.end(); ++i) {
- TEMP_FAILURE_RETRY(unlink(*i));
+ VOID_TEMP_FAILURE_RETRY(unlink(*i));
free((void*)*i);
}
cleanup_files.clear();
int r = fcntl(sock_fd, F_SETFD, FD_CLOEXEC);
if (r < 0) {
r = errno;
- TEMP_FAILURE_RETRY(::close(sock_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(sock_fd));
ostringstream oss;
oss << "OutputDataSocket::bind_and_listen: failed to fcntl on socket: " << cpp_strerror(r);
return oss.str();
if (err == EADDRINUSE) {
// The old UNIX domain socket must still be there.
// Let's unlink it and try again.
- TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
+ VOID_TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
if (bind(sock_fd, (struct sockaddr*)&address,
sizeof(struct sockaddr_un)) == 0) {
err = 0;
oss << "OutputDataSocket::bind_and_listen: "
<< "failed to listen to socket: " << cpp_strerror(err);
close(sock_fd);
- TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
+ VOID_TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
return oss.str();
}
*fd = sock_fd;
void OutputDataSocket::close_connection(int fd)
{
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
}
bool OutputDataSocket::init(const std::string &path)
// Send a byte to the shutdown pipe that the thread is listening to
char buf[1] = { 0x0 };
int ret = safe_write(m_shutdown_wr_fd, buf, sizeof(buf));
- TEMP_FAILURE_RETRY(close(m_shutdown_wr_fd));
+ VOID_TEMP_FAILURE_RETRY(close(m_shutdown_wr_fd));
m_shutdown_wr_fd = -1;
if (ret == 0) {
static void remove_cleanup_file(const char *file)
{
pthread_mutex_lock(&cleanup_lock);
- TEMP_FAILURE_RETRY(unlink(file));
+ VOID_TEMP_FAILURE_RETRY(unlink(file));
for (std::vector <const char*>::iterator i = cleanup_files.begin();
i != cleanup_files.end(); ++i) {
if (strcmp(file, *i) == 0) {
pthread_mutex_lock(&cleanup_lock);
for (std::vector <const char*>::iterator i = cleanup_files.begin();
i != cleanup_files.end(); ++i) {
- TEMP_FAILURE_RETRY(unlink(*i));
+ VOID_TEMP_FAILURE_RETRY(unlink(*i));
free((void*)*i);
}
cleanup_files.clear();
int r = fcntl(sock_fd, F_SETFD, FD_CLOEXEC);
if (r < 0) {
r = errno;
- TEMP_FAILURE_RETRY(::close(sock_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(sock_fd));
ostringstream oss;
oss << "AdminSocket::bind_and_listen: failed to fcntl on socket: " << cpp_strerror(r);
return oss.str();
err = EEXIST;
} else {
ldout(m_cct, 20) << "unlink stale file " << sock_path << dendl;
- TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
+ VOID_TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
if (bind(sock_fd, (struct sockaddr*)&address,
sizeof(struct sockaddr_un)) == 0) {
err = 0;
oss << "AdminSocket::bind_and_listen: "
<< "failed to listen to socket: " << cpp_strerror(err);
close(sock_fd);
- TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
+ VOID_TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
return oss.str();
}
*fd = sock_fd;
}
m_lock.Unlock();
- TEMP_FAILURE_RETRY(close(connection_fd));
+ VOID_TEMP_FAILURE_RETRY(close(connection_fd));
return rval;
}
// Send a byte to the shutdown pipe that the thread is listening to
char buf[1] = { 0x0 };
int ret = safe_write(m_shutdown_wr_fd, buf, sizeof(buf));
- TEMP_FAILURE_RETRY(close(m_shutdown_wr_fd));
+ VOID_TEMP_FAILURE_RETRY(close(m_shutdown_wr_fd));
m_shutdown_wr_fd = -1;
if (ret == 0) {
void close_pipe(int *fds) {
if (fds[0] >= 0)
- TEMP_FAILURE_RETRY(::close(fds[0]));
+ VOID_TEMP_FAILURE_RETRY(::close(fds[0]));
if (fds[1] >= 0)
- TEMP_FAILURE_RETRY(::close(fds[1]));
+ VOID_TEMP_FAILURE_RETRY(::close(fds[1]));
}
char *copy_pipe(int *fds) {
/* preserve original pipe contents by copying into a temporary
oss << "bufferlist::read_file(" << fn << "): read error:"
<< cpp_strerror(ret);
*error = oss.str();
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return ret;
}
else if (ret != st.st_size) {
*error = oss.str();
// not actually an error, but weird
}
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return 0;
}
if (ret) {
cerr << "bufferlist::write_fd(" << fn << "): write_fd error: "
<< cpp_strerror(ret) << std::endl;
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return ret;
}
if (TEMP_FAILURE_RETRY(::close(fd))) {
return 0;
out:
- TEMP_FAILURE_RETRY(close(pipefd[0]));
- TEMP_FAILURE_RETRY(close(pipefd[1]));
+ VOID_TEMP_FAILURE_RETRY(close(pipefd[0]));
+ VOID_TEMP_FAILURE_RETRY(close(pipefd[1]));
return ret;
#endif
}
ret = safe_write(fd, val, vallen);
if (ret) {
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
return ret;
}
ret = fsync(fd);
if (ret < 0) ret = -errno;
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
if (ret < 0) {
unlink(tmp);
return ret;
}
ret = fsync(fd);
if (ret < 0) ret = -errno;
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
return ret;
}
}
len = safe_read(fd, val, vallen - 1);
if (len < 0) {
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
return len;
}
// close sometimes returns errors, but only after write()
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
val[len] = 0;
return len;
* guarantee that nobody ever writes to stdout, even though they're not
* supposed to.
*/
- TEMP_FAILURE_RETRY(close(STDIN_FILENO));
+ VOID_TEMP_FAILURE_RETRY(close(STDIN_FILENO));
if (open("/dev/null", O_RDONLY) < 0) {
int err = errno;
derr << "global_init_daemonize: open(/dev/null) failed: error "
<< err << dendl;
exit(1);
}
- TEMP_FAILURE_RETRY(close(STDOUT_FILENO));
+ VOID_TEMP_FAILURE_RETRY(close(STDOUT_FILENO));
if (open("/dev/null", O_RDONLY) < 0) {
int err = errno;
derr << "global_init_daemonize: open(/dev/null) failed: error "
*/
int global_init_shutdown_stderr(CephContext *cct)
{
- TEMP_FAILURE_RETRY(close(STDERR_FILENO));
+ VOID_TEMP_FAILURE_RETRY(close(STDERR_FILENO));
if (open("/dev/null", O_RDONLY) < 0) {
int err = errno;
derr << "global_init_shutdown_stderr: open(/dev/null) failed: error "
if (ret < 0) {
derr << "write_pid_file: failed to write to pid file '"
<< pid_file << "': " << cpp_strerror(ret) << dendl;
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return ret;
}
if (TEMP_FAILURE_RETRY(::close(fd))) {
char buf[32];
memset(buf, 0, sizeof(buf));
ssize_t res = safe_read(fd, buf, sizeof(buf));
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
if (res < 0)
return res;
int a = atoi(buf);
__result; })
#endif
+#ifdef __cplusplus
+# define VOID_TEMP_FAILURE_RETRY(expression) \
+ static_cast<void>(TEMP_FAILURE_RETRY(expression))
+#else
+# define VOID_TEMP_FAILURE_RETRY(expression) \
+ do { (void)TEMP_FAILURE_RETRY(expression); } while (0)
+#endif
+
#if defined(__FreeBSD__) || defined(__APPLE__)
#define lseek64(fd, offset, whence) lseek(fd, offset, whence)
#endif
assert(!is_started());
if (m_fd >= 0)
- TEMP_FAILURE_RETRY(::close(m_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(m_fd));
pthread_mutex_destroy(&m_queue_mutex);
pthread_mutex_destroy(&m_flush_mutex);
void Log::reopen_log_file()
{
if (m_fd >= 0)
- TEMP_FAILURE_RETRY(::close(m_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(m_fd));
if (m_log_file.length()) {
m_fd = ::open(m_log_file.c_str(), O_CREAT|O_WRONLY|O_APPEND, 0644);
} else {
char buf[200];
int r = safe_read(fd, buf, sizeof(buf));
if (r < 0) {
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return;
}
left -= l;
}
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
cout << "done." << std::endl;
}
dout(1) << "error writing to " << g_conf->mon_cluster_log_file
<< ": " << cpp_strerror(err) << dendl;
}
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
}
}
return fd;
}
~FD() {
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
}
};
return 0;
out_fd:
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return ret;
}
ret = 0;
done:
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
fd = -1;
return ret;
}
// close
assert(writeq_empty());
assert(fd >= 0);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
fd = -1;
}
if (create && (!exist)) {
r = (*index)->created(oid, (*path)->path());
if (r < 0) {
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
derr << "error creating " << oid << " (" << (*path)->path()
<< ") in index: " << cpp_strerror(-r) << dendl;
goto fail;
Mutex::Locker l(fdcache_lock);
*outfd = fdcache.lookup(oid);
if (*outfd) {
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return 0;
} else {
*outfd = fdcache.add(oid, fd);
if (initial_seq == 0) {
int err = write_op_seq(fd, 1);
if (err < 0) {
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
derr << "mkfs: failed to write to " << current_op_seq_fn << ": "
<< cpp_strerror(err) << dendl;
goto close_fsid_fd;
char s[NAME_MAX];
snprintf(s, sizeof(s), COMMIT_SNAP_ITEM, 1ull);
ret = backend->create_checkpoint(s, NULL);
- TEMP_FAILURE_RETRY(::close(current_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(current_fd));
if (ret < 0 && ret != -EEXIST) {
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
derr << "mkfs: failed to create snap_1: " << cpp_strerror(ret) << dendl;
goto close_fsid_fd;
}
}
}
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
}
{
ret = 0;
close_fsid_fd:
- TEMP_FAILURE_RETRY(::close(fsid_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fsid_fd));
fsid_fd = -1;
close_basedir_fd:
- TEMP_FAILURE_RETRY(::close(basedir_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(basedir_fd));
if (backend != generic_backend) {
delete backend;
backend = generic_backend;
ret = read_fsid(fd, &fsid);
if (ret < 0) {
derr << "FileStore::mkjournal: read error: " << cpp_strerror(ret) << dendl;
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return ret;
}
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
ret = 0;
if (fsid_fd < 0)
return 0; // no fsid, ok.
bool inuse = lock_fsid() < 0;
- TEMP_FAILURE_RETRY(::close(fsid_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fsid_fd));
fsid_fd = -1;
return inuse;
}
*_dout << "If you are using ext3 or ext4, be sure to mount the underlying "
<< "file system with the 'user_xattr' option." << dendl;
::unlink(fn);
- TEMP_FAILURE_RETRY(::close(tmpfd));
+ VOID_TEMP_FAILURE_RETRY(::close(tmpfd));
return -ENOTSUP;
}
chain_fremovexattr(tmpfd, "user.test5");
::unlink(fn);
- TEMP_FAILURE_RETRY(::close(tmpfd));
+ VOID_TEMP_FAILURE_RETRY(::close(tmpfd));
return 0;
}
int ret = safe_read(op_fd, s, sizeof(s) - 1);
if (ret < 0) {
derr << "error reading " << current_op_seq_fn << ": " << cpp_strerror(ret) << dendl;
- TEMP_FAILURE_RETRY(::close(op_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(op_fd));
assert(!m_filestore_fail_eio || ret != -EIO);
return ret;
}
{
int fd = read_op_seq(&curr_seq);
if (fd >= 0) {
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
}
}
if (curr_seq)
derr << "FileStore::mount: failed to create current/nosnap" << dendl;
goto close_current_fd;
}
- TEMP_FAILURE_RETRY(::close(r));
+ VOID_TEMP_FAILURE_RETRY(::close(r));
} else {
// clear nosnap marker, if present.
::unlink(nosnapfn);
return 0;
close_current_fd:
- TEMP_FAILURE_RETRY(::close(current_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(current_fd));
current_fd = -1;
close_basedir_fd:
- TEMP_FAILURE_RETRY(::close(basedir_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(basedir_fd));
basedir_fd = -1;
close_fsid_fd:
- TEMP_FAILURE_RETRY(::close(fsid_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fsid_fd));
fsid_fd = -1;
done:
assert(!m_filestore_fail_eio || ret != -EIO);
ondisk_finisher.stop();
if (fsid_fd >= 0) {
- TEMP_FAILURE_RETRY(::close(fsid_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fsid_fd));
fsid_fd = -1;
}
if (op_fd >= 0) {
- TEMP_FAILURE_RETRY(::close(op_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(op_fd));
op_fd = -1;
}
if (current_fd >= 0) {
- TEMP_FAILURE_RETRY(::close(current_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(current_fd));
current_fd = -1;
}
if (basedir_fd >= 0) {
- TEMP_FAILURE_RETRY(::close(basedir_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(basedir_fd));
basedir_fd = -1;
}
_inject_failure();
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
dout(10) << __func__ << ": " << spos << " done" << dendl;
}
if (r < 0) {
dout(20) << __func__ << " no xattr" << dendl;
assert(!m_filestore_fail_eio || r != -EIO);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return 1; // no xattr
}
bufferlist bl;
bufferlist::iterator p = bl.begin();
::decode(opos, p);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return spos >= opos ? 1 : -1;
}
return 1; // if collection does not exist, there is no guard, and we can replay.
}
int ret = _check_replay_guard(fd, spos);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return ret;
}
char n[PATH_MAX];
get_attrname(name, n, PATH_MAX);
r = chain_fgetxattr(fd, n, value, size);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
out:
dout(10) << "collection_getattr " << fn << " '" << name << "' len " << size << " = " << r << dendl;
assert(!m_filestore_fail_eio || r != -EIO);
}
r = _fgetattr(fd, n, bp);
bl.push_back(bp);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
out:
dout(10) << "collection_getattr " << fn << " '" << name << "' = " << r << dendl;
assert(!m_filestore_fail_eio || r != -EIO);
goto out;
}
r = _fgetattrs(fd, aset, true);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
out:
dout(10) << "collection_getattrs " << fn << " = " << r << dendl;
assert(!m_filestore_fail_eio || r != -EIO);
}
get_attrname(name, n, PATH_MAX);
r = chain_fsetxattr(fd, n, value, size);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
out:
dout(10) << "collection_setattr " << fn << " '" << name << "' len " << size << " = " << r << dendl;
return r;
goto out;
}
r = chain_fremovexattr(fd, n);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
out:
dout(10) << "collection_rmattr " << fn << " = " << r << dendl;
return r;
if (r < 0)
break;
}
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
out:
dout(10) << "collection_setattrs " << fn << " = " << r << dendl;
return r;
int fd = ::open(new_coll, O_RDONLY);
assert(fd >= 0);
_set_replay_guard(fd, spos);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
}
dout(10) << "collection_rename '" << cid << "' to '" << ncid << "'"
if (r < 0) {
r = -errno;
derr << "detect_features: failed to lseek " << fn << ": " << cpp_strerror(r) << dendl;
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return r;
}
r = write(fd, buf, sizeof(buf));
if (r < 0) {
derr << "detect_features: failed to write to " << fn << ": " << cpp_strerror(r) << dendl;
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return r;
}
}
}
::unlink(fn);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
bool have_syncfs = false;
ret = 0;
close_fsid_fd:
- TEMP_FAILURE_RETRY(::close(fsid_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fsid_fd));
fsid_fd = -1;
return ret;
}
if (fsid_fd < 0)
return 0; // no fsid, ok.
bool inuse = lock_fsid() < 0;
- TEMP_FAILURE_RETRY(::close(fsid_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fsid_fd));
fsid_fd = -1;
return inuse;
}
return 0;
close_current_fd:
- TEMP_FAILURE_RETRY(::close(current_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(current_fd));
current_fd = -1;
close_fsid_fd:
- TEMP_FAILURE_RETRY(::close(fsid_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fsid_fd));
fsid_fd = -1;
done:
return ret;
ondisk_finisher.stop();
if (fsid_fd >= 0) {
- TEMP_FAILURE_RETRY(::close(fsid_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fsid_fd));
fsid_fd = -1;
}
if (op_fd >= 0) {
- TEMP_FAILURE_RETRY(::close(op_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(op_fd));
op_fd = -1;
}
if (current_fd >= 0) {
- TEMP_FAILURE_RETRY(::close(current_fd));
+ VOID_TEMP_FAILURE_RETRY(::close(current_fd));
current_fd = -1;
}
return -errno;
maybe_inject_failure();
int r = ::fsync(fd);
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
maybe_inject_failure();
if (r < 0)
return -errno;
static int get_indata(const char *in_file, bufferlist &indata)
{
- int fd = TEMP_FAILURE_RETRY(::open(in_file, O_RDONLY));
+ int fd = VOID_TEMP_FAILURE_RETRY(::open(in_file, O_RDONLY));
if (fd < 0) {
int err = errno;
derr << "error opening in_file '" << in_file << "': "
int err = errno;
derr << "error getting size of in_file '" << in_file << "': "
<< cpp_strerror(err) << dendl;
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return 1;
}
if (ret) {
derr << "error reading in_file '" << in_file << "': "
<< cpp_strerror(ret) << dendl;
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return 1;
}
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
derr << "read " << st.st_size << " bytes from " << in_file << dendl;
return 0;
}
if (out_file.empty() || out_file == "-") {
err = outbl.write_fd(STDOUT_FILENO);
} else {
- int out_fd = TEMP_FAILURE_RETRY(::open(out_file.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0644));
+ int out_fd = VOID_TEMP_FAILURE_RETRY(::open(out_file.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0644));
if (out_fd < 0) {
int ret = errno;
derr << " failed to create file '" << out_file << "': "
out:
if (fd != 1)
- TEMP_FAILURE_RETRY(::close(fd));
+ VOID_TEMP_FAILURE_RETRY(::close(fd));
return ret;
}
}
ret = 0;
out:
- TEMP_FAILURE_RETRY(close(fd));
+ VOID_TEMP_FAILURE_RETRY(close(fd));
delete[] buf;
return ret;
}