You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2021/02/23 09:31:20 UTC
[mynewt-mcumgr] branch master updated: zephyr: fix initialization
of file struct
This is an automated email from the ASF dual-hosted git repository.
utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git
The following commit(s) were added to refs/heads/master by this push:
new 6f52fd9 zephyr: fix initialization of file struct
6f52fd9 is described below
commit 6f52fd94cd31e57a40e21e8d96f1022166f827ab
Author: Nico Lastzka <Ni...@ATSonline.de>
AuthorDate: Mon Feb 22 12:40:17 2021 +0100
zephyr: fix initialization of file struct
With release of Zephyr 2.5 the fs_file_t structure requires initialization prior to first usage.
Signed-off-by: Nico Lastzka <Ni...@ATSonline.de>
---
cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c b/cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c
index f3eb2e4..f63ae2b 100644
--- a/cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c
+++ b/cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c
@@ -49,6 +49,7 @@ fs_mgmt_impl_read(const char *path, size_t offset, size_t len,
ssize_t bytes_read;
int rc;
+ fs_file_t_init(&file);
rc = fs_open(&file, path, FS_O_READ);
if (rc != 0) {
return MGMT_ERR_ENOENT;
@@ -123,6 +124,7 @@ fs_mgmt_impl_write(const char *path, size_t offset, const void *data,
}
}
+ fs_file_t_init(&file);
rc = fs_open(&file, path, FS_O_CREATE | FS_O_WRITE);
if (rc != 0) {
return MGMT_ERR_EUNKNOWN;