ss: Eliminate unix_use_proc()

This function is used only at a single place anymore, so replace the
call to it by it's content, which makes that specific part of
unix_show() consistent with e.g. tcp_show().

Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
Phil Sutter 2016-12-02 11:39:51 +01:00 committed by Stephen Hemminger
parent 2d0e538f3e
commit f25062e9e7
1 changed files with 2 additions and 6 deletions

View File

@ -3038,11 +3038,6 @@ static bool unix_type_skip(struct sockstat *s, struct filter *f)
return false; return false;
} }
static bool unix_use_proc(void)
{
return getenv("PROC_NET_UNIX") || getenv("PROC_ROOT");
}
static void unix_stats_print(struct sockstat *s, struct filter *f) static void unix_stats_print(struct sockstat *s, struct filter *f)
{ {
char port_name[30] = {}; char port_name[30] = {};
@ -3166,7 +3161,8 @@ static int unix_show(struct filter *f)
if (!filter_af_get(f, AF_UNIX)) if (!filter_af_get(f, AF_UNIX))
return 0; return 0;
if (!unix_use_proc() && unix_show_netlink(f) == 0) if (!getenv("PROC_NET_UNIX") && !getenv("PROC_ROOT")
&& unix_show_netlink(f) == 0)
return 0; return 0;
if ((fp = net_unix_open()) == NULL) if ((fp = net_unix_open()) == NULL)