]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tree-wide: set MSG_NOSIGNAL 2451/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 5 Jul 2018 23:15:38 +0000 (01:15 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 5 Jul 2018 23:22:06 +0000 (01:22 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/commands.c
src/lxc/network.c
src/lxc/nl.c
src/lxc/start.c

index 618b3089d2f0f8a8d341039e2f5d78dcd41c355b..9bf96fa8d437eea6f23d34524463aea3b35ec67d 100644 (file)
@@ -206,7 +206,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
 {
        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)) {
                SYSERROR("Failed to send command response %zd", ret);
                return -1;
@@ -215,7 +215,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
        if (!rsp->data || rsp->datalen <= 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) {
                SYSWARN("Failed to send command response data %zd", ret);
                return -1;
index c9497afa4a091798738dd2a6db090ae58bde6f42..63f321f46c04d9dedb12bfcbe7986d7d5f4f41c5 100644 (file)
@@ -3094,7 +3094,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
                if (netdev->type != LXC_NET_VETH)
                        continue;
 
-               ret = send(data_sock, netdev->name, IFNAMSIZ, 0);
+               ret = send(data_sock, netdev->name, IFNAMSIZ, MSG_NOSIGNAL);
                if (ret < 0)
                        return -1;
                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)
                struct lxc_netdev *netdev = iterator->elem;
 
                /* 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)
                        return -1;
 
                /* Send network device ifindex in the child's namespace to
                 * 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)
                        return -1;
        }
index 994c960df1151d3e3f13f7d6d289d663fcd20ac9..e1dd844329668af9d6fed98556cf45980ae79fe5 100644 (file)
@@ -229,7 +229,7 @@ extern int netlink_send(struct nl_handler *handler, struct nlmsg *nlmsg)
        nladdr.nl_pid = 0;
        nladdr.nl_groups = 0;
 
-       ret = sendmsg(handler->fd, &msg, 0);
+       ret = sendmsg(handler->fd, &msg, MSG_NOSIGNAL);
        if (ret < 0)
                return -errno;
 
index e9eac4f2bf5120f1788392ed60a2fb7dca3cd2bd..fe3100a902cc1535bded8a4d2c181c501bf1bab1 100644 (file)
@@ -452,7 +452,7 @@ int lxc_serve_state_clients(const char *name, struct lxc_handler *handler,
                      lxc_state2str(state), client->clientfd);
 
        again:
-               ret = send(client->clientfd, &msg, sizeof(msg), 0);
+               ret = send(client->clientfd, &msg, sizeof(msg), MSG_NOSIGNAL);
                if (ret <= 0) {
                        if (errno == EINTR) {
                                TRACE("Caught EINTR; retrying");