From: Karel Zak Date: Wed, 17 Apr 2024 10:46:50 +0000 (+0200) Subject: lslocks: remove deadcode [coverity scan] X-Git-Tag: v2.42-start~395^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82af9ab04fd31eef71f207d344fbf893a6ef4765;p=thirdparty%2Futil-linux.git lslocks: remove deadcode [coverity scan] Signed-off-by: Karel Zak --- diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index 176173f21..05784788c 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 )