diff options
author | Bernd Eckenfels <net-tools@lina.inka.de> | 2007-12-01 18:44:56 +0000 |
---|---|---|
committer | Bernd Eckenfels <net-tools@lina.inka.de> | 2007-12-01 18:44:56 +0000 |
commit | 20f0f8e12f4b638bedc67b30a5d35162b42f4abc (patch) | |
tree | 9572c5293acfba32f6a87b1f4a00e1ffe6c5a4bb /statistics.c | |
parent | Better netstat -s error handling and larger buffers (diff) | |
download | net-tools-20f0f8e12f4b638bedc67b30a5d35162b42f4abc.tar.gz net-tools-20f0f8e12f4b638bedc67b30a5d35162b42f4abc.tar.bz2 net-tools-20f0f8e12f4b638bedc67b30a5d35162b42f4abc.zip |
Faster pagesize aligned fopen for netstat -s (Eric Dumazet)
Diffstat (limited to 'statistics.c')
-rw-r--r-- | statistics.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/statistics.c b/statistics.c index 9c1d7ad..5eb8828 100644 --- a/statistics.c +++ b/statistics.c @@ -1,6 +1,6 @@ /* * Copyright 1997,1999,2000 Andi Kleen. Subject to the GPL. - * $Id: statistics.c,v 1.19 2007/12/01 18:29:05 ecki Exp $ + * $Id: statistics.c,v 1.20 2007/12/01 18:44:56 ecki Exp $ * 19980630 - i18n - Arnaldo Carvalho de Melo <acme@conectiva.com.br> * 19981113 - i18n fixes - Arnaldo Carvalho de Melo <acme@conectiva.com.br> * 19990101 - added net/netstat, -t, -u, -w supprt - Bernd Eckenfels @@ -11,6 +11,7 @@ #include <string.h> #include "config.h" #include "intl.h" +#include "proc.h" /* #define WARN 1 */ @@ -387,7 +388,7 @@ void parsesnmp(int flag_raw, int flag_tcp, int flag_udp) f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; - f = fopen("/proc/net/snmp", "r"); + f = proc_fopen("/proc/net/snmp"); if (!f) { perror(_("cannot open /proc/net/snmp")); return; @@ -401,7 +402,7 @@ void parsesnmp(int flag_raw, int flag_tcp, int flag_udp) fclose(f); - f = fopen("/proc/net/netstat", "r"); + f = proc_fopen("/proc/net/netstat"); if (f) { if (process_fd(f) <0) |