diff options
| author | xqyjlj <[email protected]> | 2023-03-28 11:20:13 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2023-03-31 10:56:37 +0800 |
| commit | 954f1d9b63d35bdefb567b8009fcaa9be86a7f9f (patch) | |
| tree | 8c6a49004df234c02889b0b67ba32594ef0d021e /components/dfs/src | |
| parent | 63c7d0ceb43f42b743f91571350092988798821a (diff) | |
🐞 fix(components/dfs/src/dfs_posix.c): use stat to implement fstat
Diffstat (limited to 'components/dfs/src')
| -rw-r--r-- | components/dfs/src/dfs_posix.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index 0956e512d7..aa9c48e329 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -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); |
