projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: sendmsg should retry on EINTR, and use MSG_NOSIGNAL
[lttng-ust.git]
/
liblttng-ust-comm
/
lttng-ust-comm.c
diff --git
a/liblttng-ust-comm/lttng-ust-comm.c
b/liblttng-ust-comm/lttng-ust-comm.c
index b90f5fe7baa0f64f8374bed6e367d96939baa312..2332dbf1a383d2b2b6e1500fb604039e53ab72e9 100644
(file)
--- a/
liblttng-ust-comm/lttng-ust-comm.c
+++ b/
liblttng-ust-comm/lttng-ust-comm.c
@@
-284,7
+284,9
@@
ssize_t ustcomm_send_unix_sock(int sock, void *buf, size_t len)
* by ignoring SIGPIPE, but we don't have this luxury on the
* libust side.
*/
* by ignoring SIGPIPE, but we don't have this luxury on the
* libust side.
*/
- ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ do {
+ ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ } while (ret < 0 && errno == EINTR);
if (ret < 0 && errno != EPIPE) {
perror("sendmsg");
}
if (ret < 0 && errno != EPIPE) {
perror("sendmsg");
}
@@
-347,7
+349,9
@@
ssize_t ustcomm_send_fds_unix_sock(int sock, void *buf, int *fds, size_t nb_fd,
msg.msg_iov = iov;
msg.msg_iovlen = 1;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
- ret = sendmsg(sock, &msg, 0);
+ do {
+ ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ } while (ret < 0 && errno == EINTR);
if (ret < 0 && errno != EPIPE) {
perror("sendmsg");
}
if (ret < 0 && errno != EPIPE) {
perror("sendmsg");
}
This page took
0.022312 seconds
and
4
git commands to generate.