mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-28 04:27:07 +08:00
[libc] fix compiling warning
This commit is contained in:
parent
94883a92fb
commit
59c128c073
@ -537,12 +537,17 @@ struct dirent *readdir(DIR *d)
|
|||||||
if (fd == RT_NULL)
|
if (fd == RT_NULL)
|
||||||
{
|
{
|
||||||
rt_set_errno(-DFS_STATUS_EBADF);
|
rt_set_errno(-DFS_STATUS_EBADF);
|
||||||
|
|
||||||
return RT_NULL;
|
return RT_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!d->num ||
|
if (d->num)
|
||||||
(d->cur += ((struct dirent *)(d->buf + d->cur))->d_reclen) >= d->num)
|
{
|
||||||
|
struct dirent* dirent_ptr;
|
||||||
|
dirent_ptr = (struct dirent*)&d->buf[d->cur];
|
||||||
|
d->cur += dirent_ptr->d_reclen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!d->num || d->cur >= d->num)
|
||||||
{
|
{
|
||||||
/* get a new entry */
|
/* get a new entry */
|
||||||
result = dfs_file_getdents(fd,
|
result = dfs_file_getdents(fd,
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
|
#ifdef RT_USING_DFS
|
||||||
|
#include <dfs_posix.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef RT_USING_PTHREADS
|
||||||
|
#include <pthread.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Reentrant versions of system calls. */
|
/* Reentrant versions of system calls. */
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user