projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: recvmsg should handle EINTR
[lttng-tools.git]
/
src
/
common
/
sessiond-comm
/
sessiond-comm.c
diff --git
a/src/common/sessiond-comm/sessiond-comm.c
b/src/common/sessiond-comm/sessiond-comm.c
index 61f4ed52ba2dfffe98591e7e65b3ae7deef70336..e767c5c2347ba2908b1137259ee8395ee1653c7c 100644
(file)
--- a/
src/common/sessiond-comm/sessiond-comm.c
+++ b/
src/common/sessiond-comm/sessiond-comm.c
@@
-267,7
+267,9
@@
ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len)
msg.msg_iov = iov;
msg.msg_iovlen = 1;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
- ret = recvmsg(sock, &msg, MSG_WAITALL);
+ do {
+ ret = recvmsg(sock, &msg, MSG_WAITALL);
+ } while (ret < 0 && errno == EINTR);
if (ret < 0) {
PERROR("recvmsg");
}
if (ret < 0) {
PERROR("recvmsg");
}
@@
-405,7
+407,9
@@
ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd)
msg.msg_control = recv_fd;
msg.msg_controllen = sizeof(recv_fd);
msg.msg_control = recv_fd;
msg.msg_controllen = sizeof(recv_fd);
- ret = recvmsg(sock, &msg, 0);
+ do {
+ ret = recvmsg(sock, &msg, 0);
+ } while (ret < 0 && errno == EINTR);
if (ret < 0) {
PERROR("recvmsg fds");
goto end;
if (ret < 0) {
PERROR("recvmsg fds");
goto end;
@@
-532,7
+536,9
@@
ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
msg.msg_controllen = sizeof(anc_buf);
#endif /* __linux__ */
msg.msg_controllen = sizeof(anc_buf);
#endif /* __linux__ */
- ret = recvmsg(sock, &msg, 0);
+ do {
+ ret = recvmsg(sock, &msg, 0);
+ } while (ret < 0 && errno == EINTR);
if (ret < 0) {
PERROR("recvmsg fds");
goto end;
if (ret < 0) {
PERROR("recvmsg fds");
goto end;
This page took
0.024379 seconds
and
4
git commands to generate.