From 512a6f8cb6079e4154ecbca4db043b89fb5ce7cd Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Wed, 27 Jan 2021 14:01:20 +0000 Subject: [PATCH] fs: shell: 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 --- subsys/fs/shell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subsys/fs/shell.c b/subsys/fs/shell.c index dbbc7d01af1..9025b3952b7 100644 --- a/subsys/fs/shell.c +++ b/subsys/fs/shell.c @@ -188,6 +188,7 @@ static int cmd_trunc(const struct shell *shell, size_t argc, char **argv) length = 0; } + fs_file_t_init(&file); err = fs_open(&file, path, FS_O_CREATE | FS_O_RDWR); if (err) { shell_error(shell, "Failed to open %s (%d)", path, err); @@ -277,6 +278,7 @@ static int cmd_read(const struct shell *shell, size_t argc, char **argv) shell_print(shell, "File size: %zd", dirent.size); + fs_file_t_init(&file); err = fs_open(&file, path, FS_O_CREATE | FS_O_RDWR); if (err) { shell_error(shell, "Failed to open %s (%d)", path, err); @@ -376,6 +378,7 @@ static int cmd_write(const struct shell *shell, size_t argc, char **argv) arg_offset = 2; } + fs_file_t_init(&file); err = fs_open(&file, path, FS_O_CREATE | FS_O_RDWR); if (err) { shell_error(shell, "Failed to open %s (%d)", path, err);