[PATCH] socketutils: e is alway not NULL here because cache is static

Weixie Cui 523516579 at qq.com
Sun Mar 1 06:27:23 UTC 2026


From: Weixie Cui <cuiweixie at gmail.com>

Signed-off-by: Weixie Cui <cuiweixie at gmail.com>
---
 src/socketutils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/socketutils.c b/src/socketutils.c
index d3a3b9283..9416c7082 100644
--- a/src/socketutils.c
+++ b/src/socketutils.c
@@ -54,7 +54,7 @@ static const char *
 get_sockaddr_by_inode_cached(const unsigned long inode)
 {
 	const cache_entry *const e = &cache[inode & CACHE_MASK];
-	return (e && inode == e->inode) ? e->details : NULL;
+	return inode == e->inode ? e->details : NULL;
 }
 
 static bool
-- 
2.39.5 (Apple Git-154)



More information about the Strace-devel mailing list