]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: Make user_ent_hash_build_init local to user_ent_hash_build()
authorPhil Sutter <phil@nwl.cc>
Fri, 2 Dec 2016 10:39:54 +0000 (11:39 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Dec 2016 22:07:46 +0000 (14:07 -0800)
By having it statically defined, there is no need for it to be global.

Signed-off-by: Phil Sutter <phil@nwl.cc>
misc/ss.c

index 71060111154e41fe9852081d822ce4791e6c356d..dcbe3a4b1e2becfd3e36a008f81709fd532e54f9 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -100,8 +100,6 @@ int show_bpf;
 int show_proc_ctx;
 int show_sock_ctx;
 int show_header = 1;
-/* If show_users & show_proc_ctx only do user_ent_hash_build() once */
-int user_ent_hash_build_init;
 int follow_events;
 int sctp_ino;
 
@@ -421,6 +419,7 @@ static void user_ent_hash_build(void)
        char *pid_context;
        char *sock_context;
        const char *no_ctx = "unavailable";
+       static int user_ent_hash_build_init;
 
        /* If show_users & show_proc_ctx set only do this once */
        if (user_ent_hash_build_init != 0)