tree-wide: set MSG_NOSIGNAL

parent 7288dfb6
...@@ -206,7 +206,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp) ...@@ -206,7 +206,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
{ {
ssize_t ret; ssize_t ret;
ret = send(fd, rsp, sizeof(*rsp), 0); ret = send(fd, rsp, sizeof(*rsp), MSG_NOSIGNAL);
if (ret < 0 || (size_t)ret != sizeof(*rsp)) { if (ret < 0 || (size_t)ret != sizeof(*rsp)) {
SYSERROR("Failed to send command response %zd", ret); SYSERROR("Failed to send command response %zd", ret);
return -1; return -1;
...@@ -215,7 +215,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp) ...@@ -215,7 +215,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
if (!rsp->data || rsp->datalen <= 0) if (!rsp->data || rsp->datalen <= 0)
return 0; return 0;
ret = send(fd, rsp->data, rsp->datalen, 0); ret = send(fd, rsp->data, rsp->datalen, MSG_NOSIGNAL);
if (ret < 0 || ret != (ssize_t)rsp->datalen) { if (ret < 0 || ret != (ssize_t)rsp->datalen) {
SYSWARN("Failed to send command response data %zd", ret); SYSWARN("Failed to send command response data %zd", ret);
return -1; return -1;
......
...@@ -3094,7 +3094,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler) ...@@ -3094,7 +3094,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
if (netdev->type != LXC_NET_VETH) if (netdev->type != LXC_NET_VETH)
continue; continue;
ret = send(data_sock, netdev->name, IFNAMSIZ, 0); ret = send(data_sock, netdev->name, IFNAMSIZ, MSG_NOSIGNAL);
if (ret < 0) if (ret < 0)
return -1; return -1;
TRACE("Sent network device name \"%s\" to child", netdev->name); TRACE("Sent network device name \"%s\" to child", netdev->name);
...@@ -3142,14 +3142,14 @@ int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handler) ...@@ -3142,14 +3142,14 @@ int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handler)
struct lxc_netdev *netdev = iterator->elem; struct lxc_netdev *netdev = iterator->elem;
/* Send network device name in the child's namespace to parent. */ /* Send network device name in the child's namespace to parent. */
ret = send(data_sock, netdev->name, IFNAMSIZ, 0); ret = send(data_sock, netdev->name, IFNAMSIZ, MSG_NOSIGNAL);
if (ret < 0) if (ret < 0)
return -1; return -1;
/* Send network device ifindex in the child's namespace to /* Send network device ifindex in the child's namespace to
* parent. * parent.
*/ */
ret = send(data_sock, &netdev->ifindex, sizeof(netdev->ifindex), 0); ret = send(data_sock, &netdev->ifindex, sizeof(netdev->ifindex), MSG_NOSIGNAL);
if (ret < 0) if (ret < 0)
return -1; return -1;
} }
......
...@@ -229,7 +229,7 @@ extern int netlink_send(struct nl_handler *handler, struct nlmsg *nlmsg) ...@@ -229,7 +229,7 @@ extern int netlink_send(struct nl_handler *handler, struct nlmsg *nlmsg)
nladdr.nl_pid = 0; nladdr.nl_pid = 0;
nladdr.nl_groups = 0; nladdr.nl_groups = 0;
ret = sendmsg(handler->fd, &msg, 0); ret = sendmsg(handler->fd, &msg, MSG_NOSIGNAL);
if (ret < 0) if (ret < 0)
return -errno; return -errno;
......
...@@ -452,7 +452,7 @@ int lxc_serve_state_clients(const char *name, struct lxc_handler *handler, ...@@ -452,7 +452,7 @@ int lxc_serve_state_clients(const char *name, struct lxc_handler *handler,
lxc_state2str(state), client->clientfd); lxc_state2str(state), client->clientfd);
again: again:
ret = send(client->clientfd, &msg, sizeof(msg), 0); ret = send(client->clientfd, &msg, sizeof(msg), MSG_NOSIGNAL);
if (ret <= 0) { if (ret <= 0) {
if (errno == EINTR) { if (errno == EINTR) {
TRACE("Caught EINTR; retrying"); TRACE("Caught EINTR; retrying");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment