From: Etienne Dechamps Date: Sun, 22 Jun 2014 08:54:45 +0000 (+0100) Subject: Move Solaris if_fd to local scope. X-Git-Tag: release-1.1pre11~106 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=638260865399693c3ced9337ef2664c5ba968a2a;p=tinc Move Solaris if_fd to local scope. This variable is never used outside of setup_device(), therefore there is no reason to declare it in global scope. --- diff --git a/src/solaris/device.c b/src/solaris/device.c index 4940ddb5..c11f60f7 100644 --- a/src/solaris/device.c +++ b/src/solaris/device.c @@ -48,7 +48,6 @@ static enum { } device_type = DEVICE_TYPE_TUN; int device_fd = -1; -static int if_fd = -1; static int ip_fd = -1; char *device = NULL; char *iface = NULL; @@ -134,6 +133,7 @@ static bool setup_device(void) { } } + int if_fd; if((if_fd = open(device, O_RDWR, 0)) < 0) { logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s\n", device, strerror(errno)); return false;