Skip to content

Commit 954f1d9

Browse files
xqyjljGuozhanxin
authored andcommitted
🐞 fix(components/dfs/src/dfs_posix.c): use stat to implement fstat
1 parent 63c7d0c commit 954f1d9

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

components/dfs/src/dfs_posix.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -353,21 +353,7 @@ int fstat(int fildes, struct stat *buf)
353353
return -1;
354354
}
355355

356-
/* it's the root directory */
357-
buf->st_dev = 0;
358-
359-
buf->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH |
360-
S_IWUSR | S_IWGRP | S_IWOTH;
361-
if (d->vnode->type == FT_DIRECTORY)
362-
{
363-
buf->st_mode &= ~S_IFREG;
364-
buf->st_mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
365-
}
366-
367-
buf->st_size = d->vnode->size;
368-
buf->st_mtime = 0;
369-
370-
return RT_EOK;
356+
return stat(d->vnode->fullpath, buf);
371357
}
372358
RTM_EXPORT(fstat);
373359

0 commit comments

Comments
 (0)