diff options
author | Paul Sokolovsky <pmiscml@gmail.com> | 2006-10-26 13:02:54 +0000 |
---|---|---|
committer | Paul Sokolovsky <pmiscml@gmail.com> | 2006-10-26 13:02:54 +0000 |
commit | 85c7d84780764f9d6a063a07435734b854c2132d (patch) | |
tree | 4d40828673469fc3b5d01b156d230456ee90e307 /packages/net-tools/files/net-tools-1.60-parse.patch | |
parent | e8b53dabb69255ec4772b07b2c5ea92d3addd1ed (diff) | |
parent | 484d308e167d41e5b28e81ccbdcfc59932139696 (diff) |
merge of '1d92511895390061fd3632d482db7306357d2698'
and '1db4aa570f4ea8df95e32e241f2b2e7e6f87ab3f'
Diffstat (limited to 'packages/net-tools/files/net-tools-1.60-parse.patch')
-rw-r--r-- | packages/net-tools/files/net-tools-1.60-parse.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/packages/net-tools/files/net-tools-1.60-parse.patch b/packages/net-tools/files/net-tools-1.60-parse.patch new file mode 100644 index 0000000000..25890f1b04 --- /dev/null +++ b/packages/net-tools/files/net-tools-1.60-parse.patch @@ -0,0 +1,70 @@ +--- net-tools-1.60/statistics.c.parse 2004-09-06 10:45:35.595130240 +0200 ++++ net-tools-1.60/statistics.c 2004-09-06 10:43:11.000000000 +0200 +@@ -289,7 +289,7 @@ + return &dummytab; + } + +-void process_fd(FILE *f) ++void process_fd(FILE *f,int file_desc) // added file_desc to show propriate error mesg + { + char buf1[1024], buf2[1024]; + char *sp, *np, *p; +@@ -297,12 +297,16 @@ + int endflag; + struct tabtab *tab; + ++ if (strcmp(buf1,"\n") == 0) // cut leading break ++ if (!fgets(buf1, sizeof buf1, f)) ++ break; + if (!fgets(buf2, sizeof buf2, f)) + break; ++ + sp = strchr(buf1, ':'); +- np = strchr(buf2, ':'); +- if (!np || !sp) +- goto formaterr; ++ np = strchr(buf2, ':'); ++ if (!np || !sp) ++ goto formaterr; + *sp = '\0'; + + tab = newtable(snmptabs, buf1); +@@ -333,7 +337,12 @@ + return; + + formaterr: +- perror(_("error parsing /proc/net/snmp")); ++ switch(file_desc) { ++ case 0: perror(_("error parsing /proc/net/snmp")); ++ break; ++ case 1: perror(_("error parsing /proc/net/netstat")); ++ break; ++ } + return; + } + +@@ -343,13 +352,13 @@ + FILE *f; + + f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; +- ++ + f = fopen("/proc/net/snmp", "r"); + if (!f) { + perror(_("cannot open /proc/net/snmp")); + return(1); + } +- process_fd(f); ++ process_fd(f,0); + + if (ferror(f)) { + perror("/proc/net/snmp"); +@@ -361,7 +370,7 @@ + f = fopen("/proc/net/netstat", "r"); + + if (f) { +- process_fd(f); ++ process_fd(f,1); + + if (ferror(f)) { + perror("/proc/net/netstat"); |