mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
🐞 fix(components/dfs/src/dfs_posix.c): use stat to implement fstat
This commit is contained in:
@@ -353,21 +353,7 @@ int fstat(int fildes, struct stat *buf)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* it's the root directory */
|
||||
buf->st_dev = 0;
|
||||
|
||||
buf->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH |
|
||||
S_IWUSR | S_IWGRP | S_IWOTH;
|
||||
if (d->vnode->type == FT_DIRECTORY)
|
||||
{
|
||||
buf->st_mode &= ~S_IFREG;
|
||||
buf->st_mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
|
||||
}
|
||||
|
||||
buf->st_size = d->vnode->size;
|
||||
buf->st_mtime = 0;
|
||||
|
||||
return RT_EOK;
|
||||
return stat(d->vnode->fullpath, buf);
|
||||
}
|
||||
RTM_EXPORT(fstat);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user