]> 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, 17 Apr 2024 10:46:50 +0000 (12:46 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lslocks.c

index 176173f21104e8c582620201cebef496619c7c86..05784788cd3ba3287310619539c82fff91fa82b4 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 )