summaryrefslogtreecommitdiff
path: root/tools/include
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/nolibc/dirent.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/include/nolibc/dirent.h b/tools/include/nolibc/dirent.h
index 2dbf4052b85a..19857369de2a 100644
--- a/tools/include/nolibc/dirent.h
+++ b/tools/include/nolibc/dirent.h
@@ -81,6 +81,7 @@ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
struct linux_dirent64 *ldir = (void *)buf;
intptr_t i = (intptr_t)dirp;
int fd, ret;
+ off_t off;
if (i >= 0)
return EBADF;
@@ -100,9 +101,9 @@ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
* readdir() can only return one entry at a time.
* Make sure the non-returned ones are not skipped.
*/
- ret = _sys_lseek(fd, ldir->d_off, SEEK_SET);
- if (ret < 0)
- return -ret;
+ off = _sys_lseek(fd, ldir->d_off, SEEK_SET);
+ if (off < 0)
+ return -off;
entry->d_ino = ldir->d_ino;
/* the destination should always be big enough */