mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-11 17:10:13 +00:00
tools/nolibc/dirent: avoid errno in readdir_r
Using errno is not possible when NOLIBC_IGNORE_ERRNO is set. Use
sys_lseek instead of lseek as that avoids using errno.
Fixes: 665fa8dea90d ("tools/nolibc: add support for directory access")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
parent
c485ca3aff
commit
4ada5679f1
@ -86,9 +86,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 = lseek(fd, ldir->d_off, SEEK_SET);
|
||||
if (ret == -1)
|
||||
return errno;
|
||||
ret = sys_lseek(fd, ldir->d_off, SEEK_SET);
|
||||
if (ret < 0)
|
||||
return -ret;
|
||||
|
||||
entry->d_ino = ldir->d_ino;
|
||||
/* the destination should always be big enough */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user