Unnecessary __block
authorJagger <robert@swiecki.net>
Wed, 9 Mar 2016 22:48:07 +0000 (23:48 +0100)
committerJagger <robert@swiecki.net>
Wed, 9 Mar 2016 22:48:07 +0000 (23:48 +0100)
net.c
subproc.c

diff --git a/net.c b/net.c
index dd1c7cd6c4824a5f6a0a631bc4506733478e08d9..806281fd305c831a9f01475ff3c6b3978e8a68be 100644 (file)
--- 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;
index 9bc9a2b95c248bec52bc0a2bf22c9305502a5399..b7559942b5c38ef1147828c41498095408d28f31 100644 (file)
--- 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);