aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2024-04-17 12:46:50 +0200
committerKarel Zak <kzak@redhat.com>2024-04-17 12:46:50 +0200
commit82af9ab04fd31eef71f207d344fbf893a6ef4765 (patch)
treefa2d2fd470765043427e67c0f81fcd8a308f47f0
parentf94aa460eafdfc096afe0dd4a490094006d6b238 (diff)
downloadutil-linux-82af9ab04fd31eef71f207d344fbf893a6ef4765.tar.gz
lslocks: remove deadcode [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--misc-utils/lslocks.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c
index 176173f211..05784788cd 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 )