projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: perform macro expansion on tracepoint signatures
[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 7e55cff556c6ced0314329401fdbe866480cf160..078b56a01bb68c49c2322fc2a8f454d597305314 100644
(file)
--- a/
liblttng-ust-comm/lttng-ust-comm.c
+++ b/
liblttng-ust-comm/lttng-ust-comm.c
@@
-255,8
+255,10
@@
ssize_t ustcomm_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, 0);
- if (ret < 0) {
+ do {
+ ret = recvmsg(sock, &msg, 0);
+ } while (ret < 0 && errno == EINTR);
+ if (ret < 0 && errno != EPIPE) {
perror("recvmsg");
}
perror("recvmsg");
}
@@
-289,8
+291,10
@@
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);
- if (ret < 0) {
+ do {
+ ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ } while (ret < 0 && errno == EINTR);
+ if (ret < 0 && errno != EPIPE) {
perror("sendmsg");
}
perror("sendmsg");
}
@@
-306,10
+310,9
@@
int ustcomm_close_unix_sock(int sock)
{
int ret;
{
int ret;
- /* Shutdown receptions and transmissions */
- ret = shutdown(sock, SHUT_RDWR);
+ ret = close(sock);
if (ret < 0) {
if (ret < 0) {
- perror("
shutdown
");
+ perror("
close
");
}
return ret;
}
return ret;
@@
-353,8
+356,10
@@
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);
- if (ret < 0) {
+ do {
+ ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ } while (ret < 0 && errno == EINTR);
+ if (ret < 0 && errno != EPIPE) {
perror("sendmsg");
}
perror("sendmsg");
}
@@
-469,8
+474,13
@@
int ustcomm_recv_fd(int sock)
msg.msg_control = recv_fd;
msg.msg_controllen = sizeof(recv_fd);
msg.msg_control = recv_fd;
msg.msg_controllen = sizeof(recv_fd);
- if ((ret = recvmsg(sock, &msg, 0)) < 0) {
- perror("recvmsg");
+ do {
+ ret = recvmsg(sock, &msg, 0);
+ } while (ret < 0 && errno == EINTR);
+ if (ret < 0) {
+ if (errno != EPIPE) {
+ perror("recvmsg");
+ }
goto end;
}
if (ret != sizeof(data_fd)) {
goto end;
}
if (ret != sizeof(data_fd)) {
This page took
0.024906 seconds
and
4
git commands to generate.