fd_inc_sndbuf(fd, SNDBUF_SIZE);
if (!__sync_bool_compare_and_swap(&fd_plus_one, 0, fd+1)) {
- close_nointr_nofail(fd);
+ safe_close(fd);
goto retry;
}
n = writev(buffer_fd, w, j);
if (n < 0) {
- close_nointr_nofail(buffer_fd);
+ safe_close(buffer_fd);
return -errno;
}
mh.msg_controllen = cmsg->cmsg_len;
k = sendmsg(fd, &mh, MSG_NOSIGNAL);
- close_nointr_nofail(buffer_fd);
+ safe_close(buffer_fd);
if (k < 0)
return -errno;
r = connect(fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path));
if (r < 0) {
- close_nointr_nofail(fd);
+ safe_close(fd);
return -errno;
}
if (shutdown(fd, SHUT_RD) < 0) {
- close_nointr_nofail(fd);
+ safe_close(fd);
return -errno;
}
r = loop_write(fd, header, l, false);
if (r < 0) {
- close_nointr_nofail(fd);
+ safe_close(fd);
return (int) r;
}
if ((size_t) r != l) {
- close_nointr_nofail(fd);
+ safe_close(fd);
return -errno;
}