From ebe327990f4a0cdb62b0edd9a48e2c06c1524052 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Sun, 2 Nov 2008 15:38:07 -0200 Subject: Fix crash/close socket --- hardinfo2/arch/linux/common/net.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hardinfo2/arch/linux/common/net.h') diff --git a/hardinfo2/arch/linux/common/net.h b/hardinfo2/arch/linux/common/net.h index 8c083a9e..6575d199 100644 --- a/hardinfo2/arch/linux/common/net.h +++ b/hardinfo2/arch/linux/common/net.h @@ -216,6 +216,7 @@ void get_net_info(char *if_name, NetInfo * netinfo) #endif shutdown(fd, 0); + close(fd); } static struct { @@ -309,6 +310,9 @@ static void scan_net_interfaces_24(void) network_icons = g_strdup(""); proc_net = fopen("/proc/net/dev", "r"); + if (!proc_net) + return; + while (fgets(buffer, 256, proc_net)) { if (strchr(buffer, ':')) { gint trash; -- cgit v1.2.3