From aff93f9d71a625747b8dd1e2e4be56381897874d Mon Sep 17 00:00:00 2001 From: Jagger Date: Wed, 9 Mar 2016 23:48:07 +0100 Subject: [PATCH] Unnecessary __block --- net.c | 10 +++++----- subproc.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net.c b/net.c index dd1c7cd..806281f 100644 --- a/net.c +++ b/net.c @@ -57,7 +57,7 @@ bool netInitNsFromParent(struct nsjconf_t * nsjconf, int pid) return true; } - __block struct nl_sock *sk = nl_socket_alloc(); + struct nl_sock *sk = nl_socket_alloc(); if (sk == NULL) { LOG_E("Could not allocate socket with nl_socket_alloc()"); return false; @@ -70,14 +70,14 @@ bool netInitNsFromParent(struct nsjconf_t * nsjconf, int pid) return false; } - __block struct rtnl_link *rmv = rtnl_link_macvlan_alloc(); + struct rtnl_link *rmv = rtnl_link_macvlan_alloc(); if (rmv == NULL) { LOG_E("rtnl_link_macvlan_alloc(): %s", nl_geterror(err)); return false; } defer(rtnl_link_put(rmv)); - __block struct nl_cache *link_cache; + struct nl_cache *link_cache; if ((err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache)) < 0) { LOG_E("rtnl_link_alloc_cache(): %s", nl_geterror(err)); return false; @@ -322,7 +322,7 @@ void netConnToText(int fd, bool remote, char *buf, size_t s, struct sockaddr_in6 static bool netIfaceUp(const char *ifacename) { - __block int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); + int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); if (sock == -1) { PLOG_E("socket(AF_INET, SOCK_STREAM, IPPROTO_IP)"); return false; @@ -355,7 +355,7 @@ static bool netConfigureVs(struct nsjconf_t *nsjconf) snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", IFACE_NAME); struct in_addr addr; - __block int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); + int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); if (sock == -1) { PLOG_E("socket(AF_INET, SOCK_STREAM, IPPROTO_IP)"); return false; diff --git a/subproc.c b/subproc.c index 9bc9a2b..b755994 100644 --- a/subproc.c +++ b/subproc.c @@ -247,7 +247,7 @@ void subprocRunChild(struct nsjconf_t *nsjconf, int fd_in, int fd_out, int fd_er PLOG_E("socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC) failed"); return; } - __block int subproc_sock = sv[1]; + int subproc_sock = sv[1]; defer(close(subproc_sock)); pid_t pid = syscall(__NR_clone, (uintptr_t) flags, NULL, NULL, NULL, (uintptr_t) 0);