diff options
Diffstat (limited to 'osi/src/socket.c')
-rw-r--r-- | osi/src/socket.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/osi/src/socket.c b/osi/src/socket.c index 91f084e79..9905ae300 100644 --- a/osi/src/socket.c +++ b/osi/src/socket.c @@ -121,7 +121,7 @@ bool socket_listen(const socket_t *socket, port_t port) { socket_t *socket_accept(const socket_t *socket) { assert(socket != NULL); - int fd = accept(socket->fd, NULL, NULL); + int fd = TEMP_FAILURE_RETRY(accept(socket->fd, NULL, NULL)); if (fd == INVALID_FD) { LOG_ERROR("%s unable to accept socket: %s", __func__, strerror(errno)); return NULL; @@ -142,14 +142,14 @@ ssize_t socket_read(const socket_t *socket, void *buf, size_t count) { assert(socket != NULL); assert(buf != NULL); - return recv(socket->fd, buf, count, MSG_DONTWAIT); + return TEMP_FAILURE_RETRY(recv(socket->fd, buf, count, MSG_DONTWAIT)); } ssize_t socket_write(const socket_t *socket, const void *buf, size_t count) { assert(socket != NULL); assert(buf != NULL); - return send(socket->fd, buf, count, MSG_DONTWAIT); + return TEMP_FAILURE_RETRY(send(socket->fd, buf, count, MSG_DONTWAIT)); } ssize_t socket_write_and_transfer_fd(const socket_t *socket, const void *buf, size_t count, int fd) { @@ -179,7 +179,7 @@ ssize_t socket_write_and_transfer_fd(const socket_t *socket, const void *buf, si header->cmsg_len = CMSG_LEN(sizeof(int)); *(int *)CMSG_DATA(header) = fd; - ssize_t ret = sendmsg(socket->fd, &msg, MSG_DONTWAIT); + ssize_t ret = TEMP_FAILURE_RETRY(sendmsg(socket->fd, &msg, MSG_DONTWAIT)); close(fd); return ret; } @@ -188,7 +188,7 @@ ssize_t socket_bytes_available(const socket_t *socket) { assert(socket != NULL); int size = 0; - if (ioctl(socket->fd, FIONREAD, &size) == -1) + if (TEMP_FAILURE_RETRY(ioctl(socket->fd, FIONREAD, &size)) == -1) return -1; return size; } |