From: Karel Zak Date: Wed, 17 Apr 2024 10:46:50 +0000 (+0200) Subject: lslocks: remove deadcode [coverity scan] X-Git-Tag: v2.40.3~72 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2993f460a2414db197414d3094d34def63207bbf;p=thirdparty%2Futil-linux.git lslocks: remove deadcode [coverity scan] Signed-off-by: Karel Zak (cherry picked from commit 82af9ab04fd31eef71f207d344fbf893a6ef4765) --- 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 )