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.
This commit is contained in:
parent
9bfc228ef5
commit
6382608653
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,6 @@ static enum {
|
||||||
} device_type = DEVICE_TYPE_TUN;
|
} device_type = DEVICE_TYPE_TUN;
|
||||||
|
|
||||||
int device_fd = -1;
|
int device_fd = -1;
|
||||||
static int if_fd = -1;
|
|
||||||
static int ip_fd = -1;
|
static int ip_fd = -1;
|
||||||
char *device = NULL;
|
char *device = NULL;
|
||||||
char *iface = 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) {
|
if((if_fd = open(device, O_RDWR, 0)) < 0) {
|
||||||
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s\n", device, strerror(errno));
|
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s\n", device, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue