From: Björn Steinbrink Date: Thu, 3 Apr 2008 09:42:41 +0000 (+0200) Subject: ss: Fix return value checks for net_*_open X-Git-Tag: v2.6.25~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69cae645b28edbba53c8601ddeba01430e5e9da0;p=thirdparty%2Fiproute2.git ss: Fix return value checks for net_*_open In ss.c, generic_proc_open(), for which the net_*_open functions are just convenient wrappers, uses fopen, so errors are signalled by a NULL return value. Some checks were expecting negative values instead, fix them. Signed-off-by: Björn Steinbrink Signed-off-by: Stephen Hemminger --- diff --git a/misc/ss.c b/misc/ss.c index 535585152..79193e545 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1641,7 +1641,7 @@ static int tcp_show(struct filter *f, int socktype) } if (f->families & (1<families & (1<= 0) { + (fp = net_tcp6_open()) != NULL) { setbuffer(fp, buf, bufsize); if (generic_record_read(fp, tcp_show_line, f, AF_INET6)) goto outerr; @@ -1773,7 +1773,7 @@ int udp_show(struct filter *f) dg_proto = UDP_PROTO; if (f->families&(1<families&(1<= 0) { + (fp = net_udp6_open()) != NULL) { if (generic_record_read(fp, dgram_show_line, f, AF_INET6)) goto outerr; fclose(fp); @@ -1805,7 +1805,7 @@ int raw_show(struct filter *f) dg_proto = RAW_PROTO; if (f->families&(1<families&(1<= 0) { + (fp = net_raw6_open()) != NULL) { if (generic_record_read(fp, dgram_show_line, f, AF_INET6)) goto outerr; fclose(fp);