Close all filedescriptors in Solaris close_device().

This commit is contained in:
Guus Sliepen 2011-01-02 16:50:24 +01:00
parent f99661a4ca
commit 3ce5e292da

View file

@ -34,6 +34,7 @@
#define DEFAULT_DEVICE "/dev/tun"
int device_fd = -1;
int ip_fd = -1, if_fd = -1;
char *device = NULL;
char *iface = NULL;
static char *device_info = NULL;
@ -42,7 +43,6 @@ static uint64_t device_total_in = 0;
static uint64_t device_total_out = 0;
bool setup_device(void) {
int ip_fd = -1, if_fd = -1;
int ppa;
char *ptr;
@ -105,6 +105,8 @@ bool setup_device(void) {
}
void close_device(void) {
close(if_fd);
close(ip_fd);
close(device_fd);
free(device);