tests/settings: Add fs_file_t type variable initializations

The commit adds initializations of fs_file_t variables in preparation
for fs_open function change that will require fs_file_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2021-01-25 17:36:24 +00:00 committed by Anas Nashif
commit 6bb3706606

View file

@ -151,6 +151,8 @@ int fsutil_read_file(const char *path, off_t offset, size_t len, void *dst,
int rc; int rc;
ssize_t r_len = 0; ssize_t r_len = 0;
fs_file_t_init(&file);
rc = fs_open(&file, path, FS_O_CREATE | FS_O_RDWR); rc = fs_open(&file, path, FS_O_CREATE | FS_O_RDWR);
if (rc != 0) { if (rc != 0) {
return rc; return rc;
@ -172,6 +174,8 @@ int fsutil_write_file(const char *path, const void *data, size_t len)
struct fs_file_t file; struct fs_file_t file;
int rc; int rc;
fs_file_t_init(&file);
rc = fs_open(&file, path, FS_O_CREATE | FS_O_RDWR); rc = fs_open(&file, path, FS_O_CREATE | FS_O_RDWR);
if (rc != 0) { if (rc != 0) {
return rc; return rc;