You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by bt...@apache.org on 2021/05/16 08:13:15 UTC
[incubator-nuttx] branch master updated: fs/hostfs: fix bug about
getting error file size by fstat
This is an automated email from the ASF dual-hosted git repository.
btashton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 9980a1c fs/hostfs: fix bug about getting error file size by fstat
9980a1c is described below
commit 9980a1c27dfef1796b243417bb703da3ae0811d7
Author: Jiuzhu Dong <do...@xiaomi.com>
AuthorDate: Fri Apr 23 17:44:03 2021 +0800
fs/hostfs: fix bug about getting error file size by fstat
Change-Id: I10a0d52da649e4c3138e5a2301bcb6525e2e3350
Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
---
fs/hostfs/hostfs_rpmsg.h | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/fs/hostfs/hostfs_rpmsg.h b/fs/hostfs/hostfs_rpmsg.h
index 6482f02..b5b9822 100644
--- a/fs/hostfs/hostfs_rpmsg.h
+++ b/fs/hostfs/hostfs_rpmsg.h
@@ -116,9 +116,17 @@ begin_packed_struct struct hostfs_rpmsg_ioctl_s
begin_packed_struct struct hostfs_rpmsg_fstat_s
{
struct hostfs_rpmsg_header_s header;
- int32_t fd;
- uint32_t reserved;
- struct stat buf;
+ union
+ {
+ struct stat buf;
+ uint32_t reserved[16];
+ };
+
+ union
+ {
+ int32_t fd;
+ char pathname[0];
+ };
} end_packed_struct;
begin_packed_struct struct hostfs_rpmsg_ftruncate_s
@@ -169,17 +177,6 @@ begin_packed_struct struct hostfs_rpmsg_mkdir_s
#define hostfs_rpmsg_rmdir_s hostfs_rpmsg_opendir_s
#define hostfs_rpmsg_rename_s hostfs_rpmsg_opendir_s
-
-begin_packed_struct struct hostfs_rpmsg_stat_s
-{
- struct hostfs_rpmsg_header_s header;
- union
- {
- struct stat buf;
- uint32_t reserved[16];
- };
-
- char pathname[0];
-} end_packed_struct;
+#define hostfs_rpmsg_stat_s hostfs_rpmsg_fstat_s
#endif /* __FS_HOSTFS_HOSTFS_RPMSG_H */