diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index 18922e546..941ef7f06 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -192,8 +192,10 @@ static char *get_filename_sz(ino_t inode, pid_t lock_pid, size_t *size) !strcmp(dp->d_name, "..")) continue; + errno = 0; + /* care only for numerical descriptors */ - if (!strtol(dp->d_name, (char **) NULL, 10)) + if (!strtol(dp->d_name, (char **) NULL, 10) || errno) continue; if (!fstatat(fd, dp->d_name, &sb, 0)