From: Christian Brauner Date: Fri, 26 Feb 2021 11:22:31 +0000 (+0100) Subject: network: fix coding style in lxc_create_network_unpriv_exec() X-Git-Tag: lxc-4.0.7~199 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07d608d5b112979c90ea14b65ffbedab8232703a;p=thirdparty%2Flxc.git network: fix coding style in lxc_create_network_unpriv_exec() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/network.c b/src/lxc/network.c index 594e8403e..57956fa3c 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -2545,8 +2545,10 @@ int lxc_find_gateway_addresses(struct lxc_handler *handler) } #define LXC_USERNIC_PATH LIBEXECDIR "/lxc/lxc-user-nic" -static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcname, - struct lxc_netdev *netdev, pid_t pid, unsigned int hooks_version) +static int lxc_create_network_unpriv_exec(const char *lxcpath, + const char *lxcname, + struct lxc_netdev *netdev, pid_t pid, + unsigned int hooks_version) { int ret; pid_t child; @@ -2557,7 +2559,9 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna size_t retlen; if (netdev->type != LXC_NET_VETH) - return log_error_errno(-1, errno, "Network type %d not support for unprivileged use", netdev->type); + return log_error_errno(-1, errno, + "Network type %d not support for unprivileged use", + netdev->type); ret = pipe(pipefd); if (ret < 0) @@ -2599,8 +2603,7 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna pidstr[sizeof(pidstr) - 1] = '\0'; INFO("Execing lxc-user-nic create %s %s %s veth %s %s", lxcpath, - lxcname, pidstr, netdev_link, - !is_empty_string(netdev->name) ? netdev->name : "(null)"); + lxcname, pidstr, netdev_link, !is_empty_string(netdev->name) ? netdev->name : "(null)"); if (!is_empty_string(netdev->name)) execlp(LXC_USERNIC_PATH, LXC_USERNIC_PATH, "create", lxcpath, lxcname, pidstr, "veth", netdev_link, @@ -2627,7 +2630,8 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna ret = wait_for_pid(child); close(pipefd[0]); if (ret != 0 || bytes < 0) - return log_error(-1, "lxc-user-nic failed to configure requested network: %s", buffer[0] != '\0' ? buffer : "(null)"); + return log_error(-1, "lxc-user-nic failed to configure requested network: %s", + buffer[0] != '\0' ? buffer : "(null)"); TRACE("Received output \"%s\" from lxc-user-nic", buffer); /* netdev->name */ @@ -2644,7 +2648,8 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna if (retlen < IFNAMSIZ) retlen = strlcpy(netdev->created_name, token, IFNAMSIZ); if (retlen >= IFNAMSIZ) - return log_error_errno(-1, E2BIG, "Container side veth device name returned by lxc-user-nic is too long"); + return log_error_errno(-1, E2BIG, + "Container side veth device name returned by lxc-user-nic is too long"); /* netdev->ifindex */ token = strtok_r(NULL, ":", &saveptr); @@ -2653,7 +2658,8 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna ret = lxc_safe_int(token, &netdev->ifindex); if (ret < 0) - return log_error_errno(-1, -ret, "Failed to convert string \"%s\" to integer", token); + return log_error_errno(-1, -ret, + "Failed to convert string \"%s\" to integer", token); /* netdev->priv.veth_attr.veth1 */ token = strtok_r(NULL, ":", &saveptr); @@ -2662,7 +2668,8 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna retlen = strlcpy(netdev->priv.veth_attr.veth1, token, IFNAMSIZ); if (retlen >= IFNAMSIZ) - return log_error_errno(-1, E2BIG, "Host side veth device name returned by lxc-user-nic is too long"); + return log_error_errno(-1, E2BIG, + "Host side veth device name returned by lxc-user-nic is too long"); /* netdev->priv.veth_attr.ifindex */ token = strtok_r(NULL, ":", &saveptr); @@ -2671,7 +2678,8 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna ret = lxc_safe_int(token, &netdev->priv.veth_attr.ifindex); if (ret < 0) - return log_error_errno(-1, -ret, "Failed to convert string \"%s\" to integer", token); + return log_error_errno(-1, -ret, + "Failed to convert string \"%s\" to integer", token); if (netdev->upscript) { char *argv[] = { @@ -2685,7 +2693,7 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna netdev->upscript, "up", argv); if (ret < 0) return -1; - } + } return 0; }