]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tree-wide: s/recv()/lxc_recv_nointr()/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 3 Sep 2018 12:41:48 +0000 (14:41 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 4 Sep 2018 11:59:13 +0000 (13:59 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/commands.c
src/lxc/commands_utils.c
src/lxc/network.c

index db987693541ce2dc50a0db38efe80fc041afacf5..741210bb47a5c9afc3bc9dee72013ee91b691579 100644 (file)
@@ -1166,7 +1166,7 @@ static int lxc_cmd_handler(int fd, uint32_t events, void *data,
                        goto out_close;
                }
 
-               ret = recv(fd, reqdata, req.datalen, 0);
+               ret = lxc_recv_nointr(fd, reqdata, req.datalen, 0);
                if (ret != req.datalen) {
                        WARN("Failed to receive full command request. Ignoring "
                             "request for \"%s\"", lxc_cmd_str(req.cmd));
index bb61797c85f2778e40e63d8a67875be99aca8f86..d079d7116912b91c460a1458708e058b9c01c3d9 100644 (file)
@@ -32,6 +32,7 @@
 #include "commands.h"
 #include "commands_utils.h"
 #include "initutils.h"
+#include "file_utils.h"
 #include "log.h"
 #include "lxclock.h"
 #include "monitor.h"
@@ -61,14 +62,8 @@ int lxc_cmd_sock_rcv_state(int state_client_fd, int timeout)
 
        memset(&msg, 0, sizeof(msg));
 
-again:
-       ret = recv(state_client_fd, &msg, sizeof(msg), 0);
+       ret = lxc_recv_nointr(state_client_fd, &msg, sizeof(msg), 0);
        if (ret < 0) {
-               if (errno == EINTR) {
-                       TRACE("Caught EINTR; retrying");
-                       goto again;
-               }
-
                SYSERROR("Failed to receive message");
                return -1;
        }
index 56ca12b3b276bdc20c36d9b1659284689df58620..a2a35baf313a8f997961725fec6d8172e965aa6f 100644 (file)
@@ -48,6 +48,7 @@
 #include "af_unix.h"
 #include "conf.h"
 #include "config.h"
+#include "file_utils.h"
 #include "log.h"
 #include "macro.h"
 #include "network.h"
@@ -3081,7 +3082,7 @@ int lxc_network_recv_veth_names_from_parent(struct lxc_handler *handler)
                if (netdev->type != LXC_NET_VETH)
                        continue;
 
-               ret = recv(data_sock, netdev->name, IFNAMSIZ, 0);
+               ret = lxc_recv_nointr(data_sock, netdev->name, IFNAMSIZ, 0);
                if (ret < 0)
                        return -1;
                TRACE("Received network device name \"%s\" from parent", netdev->name);
@@ -3136,14 +3137,14 @@ int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *handler)
                /* Receive network device name in the child's namespace to
                 * parent.
                 */
-               ret = recv(data_sock, netdev->name, IFNAMSIZ, 0);
+               ret = lxc_recv_nointr(data_sock, netdev->name, IFNAMSIZ, 0);
                if (ret < 0)
                        return -1;
 
                /* Receive network device ifindex in the child's namespace to
                 * parent.
                 */
-               ret = recv(data_sock, &netdev->ifindex, sizeof(netdev->ifindex), 0);
+               ret = lxc_recv_nointr(data_sock, &netdev->ifindex, sizeof(netdev->ifindex), 0);
                if (ret < 0)
                        return -1;
        }