diff options
author | Peilin Ye <peilin.ye@bytedance.com> | 2022-05-24 19:52:36 -0700 |
---|---|---|
committer | David Ahern <dsahern@kernel.org> | 2022-05-30 09:54:12 -0600 |
commit | ea3b57ec3991a576a6aa7276979db518fd5488ce (patch) | |
tree | 4515191bdf3443b991390ff750f86631080765fe | |
parent | cd845a85681bf2851b38041587fa75605beebbe9 (diff) | |
download | iproute2-ea3b57ec3991a576a6aa7276979db518fd5488ce.tar.gz |
ss: Delete unnecessary call to snprintf() in user_ent_hash_build()
'name' is already $PROC_ROOT/$PID/fd/$FD there, no need to rebuild the
string.
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
-rw-r--r-- | misc/ss.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -652,10 +652,7 @@ static void user_ent_hash_build(void) sscanf(lnk, "socket:[%u]", &ino); - snprintf(tmp, sizeof(tmp), "%s/%d/fd/%s", - root, pid, d1->d_name); - - if (getfilecon(tmp, &sock_context) <= 0) + if (getfilecon(name, &sock_context) <= 0) sock_context = strdup(no_ctx); if (process[0] == '\0') { |