Skip to content

Commit

Permalink
tree-wide: s/recv()/lxc_recv_nointr()/g
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Sep 30, 2018
1 parent 8ab04f0 commit d07aa0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/lxc/commands.c
Expand Up @@ -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));
Expand Down
9 changes: 2 additions & 7 deletions src/lxc/commands_utils.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
Expand Down
7 changes: 4 additions & 3 deletions src/lxc/network.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d07aa0e

Please sign in to comment.