aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/arch/linux/common/net.h
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2008-11-02 15:38:07 -0200
committerLeandro A. F. Pereira <leandro@hardinfo.org>2008-11-02 15:38:07 -0200
commitebe327990f4a0cdb62b0edd9a48e2c06c1524052 (patch)
tree0b883ec373649d657dd205b39e2c584aba7f84ac /hardinfo2/arch/linux/common/net.h
parent4d990378aecf6a692b7e0c4d4a910dac900a344d (diff)
Fix crash/close socket
Diffstat (limited to 'hardinfo2/arch/linux/common/net.h')
-rw-r--r--hardinfo2/arch/linux/common/net.h4
1 files changed, 4 insertions, 0 deletions
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;