From 2993f460a2414db197414d3094d34def63207bbf Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 17 Apr 2024 12:46:50 +0200 Subject: [PATCH] lslocks: remove deadcode [coverity scan] Signed-off-by: Karel Zak (cherry picked from commit 82af9ab04fd31eef71f207d344fbf893a6ef4765) --- misc-utils/lslocks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index a630c3d65..175ee3d2a 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -221,7 +221,6 @@ static char *get_filename_sz(ino_t inode, pid_t lock_pid, size_t *size) struct stat sb; struct dirent *dp; DIR *dirp; - size_t sz; int fd; char path[PATH_MAX] = { 0 }, sym[PATH_MAX] = { 0 }, *ret = NULL; @@ -241,7 +240,7 @@ static char *get_filename_sz(ino_t inode, pid_t lock_pid, size_t *size) if (!(dirp = opendir(path))) return NULL; - if ((sz = strlen(path)) >= (sizeof(path) - 2)) + if (strlen(path) >= (sizeof(path) - 2)) goto out; if ((fd = dirfd(dirp)) < 0 ) -- 2.47.2