summaryrefslogtreecommitdiff
path: root/system-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/system-linux.c b/system-linux.c
index 1dbb651..d09fd63 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -19,7 +19,7 @@
static int sock_ioctl = -1;
static struct nl_sock *sock_rtnl = NULL;
-static void __init system_init(void)
+int system_init(void)
{
sock_ioctl = socket(AF_LOCAL, SOCK_DGRAM, 0);
fcntl(sock_ioctl, F_SETFD, fcntl(sock_ioctl, F_GETFD) | FD_CLOEXEC);
@@ -30,12 +30,14 @@ static void __init system_init(void)
sock_rtnl = NULL;
}
}
+
+ return -(sock_ioctl < 0 || !sock_rtnl);
}
static int system_rtnl_call(struct nl_msg *msg)
{
- return -!!(!sock_rtnl || nl_send_auto_complete(sock_rtnl, msg)
- || nl_wait_for_ack(sock_rtnl));
+ return -(nl_send_auto_complete(sock_rtnl, msg)
+ || nl_wait_for_ack(sock_rtnl));
}
int system_bridge_addbr(struct device *bridge)