Close all filedescriptors in Solaris close_device().
This commit is contained in:
parent
f99661a4ca
commit
3ce5e292da
1 changed files with 3 additions and 1 deletions
|
|
@ -34,6 +34,7 @@
|
||||||
#define DEFAULT_DEVICE "/dev/tun"
|
#define DEFAULT_DEVICE "/dev/tun"
|
||||||
|
|
||||||
int device_fd = -1;
|
int device_fd = -1;
|
||||||
|
int ip_fd = -1, if_fd = -1;
|
||||||
char *device = NULL;
|
char *device = NULL;
|
||||||
char *iface = NULL;
|
char *iface = NULL;
|
||||||
static char *device_info = NULL;
|
static char *device_info = NULL;
|
||||||
|
|
@ -42,7 +43,6 @@ static uint64_t device_total_in = 0;
|
||||||
static uint64_t device_total_out = 0;
|
static uint64_t device_total_out = 0;
|
||||||
|
|
||||||
bool setup_device(void) {
|
bool setup_device(void) {
|
||||||
int ip_fd = -1, if_fd = -1;
|
|
||||||
int ppa;
|
int ppa;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
|
|
@ -105,6 +105,8 @@ bool setup_device(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void close_device(void) {
|
void close_device(void) {
|
||||||
|
close(if_fd);
|
||||||
|
close(ip_fd);
|
||||||
close(device_fd);
|
close(device_fd);
|
||||||
|
|
||||||
free(device);
|
free(device);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue