]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslocks: remove deadcode [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 17 Apr 2024 10:46:50 +0000 (12:46 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 10 Jul 2024 14:19:01 +0000 (16:19 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 82af9ab04fd31eef71f207d344fbf893a6ef4765)

misc-utils/lslocks.c

index a630c3d65916c77e3538ebc9d20caee8e6e561e5..175ee3d2ac1f2ecb45b32f6bfb33b2eb9904b407 100644 (file)
@@ -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 )