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 32827ad  zephyr: Add file open flags to fs_open calls
32827ad is described below

commit 32827ad6db87042c0979c18eeef2afa7714391e5
Author: Dominik Ermel <dominik.er...@nordicsemi.no>
AuthorDate: Tue Jul 14 23:02:37 2020 +0000

    zephyr: Add file open flags to fs_open calls
    
    With addition of open flags to fs_open calls, all invocations that do
    not provide them require change.
    
    Signed-off-by: Dominik Ermel <dominik.er...@nordicsemi.no>
---
 cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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 66af8c4..f3eb2e4 100644
--- a/cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c
+++ b/cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c
@@ -49,9 +49,9 @@ fs_mgmt_impl_read(const char *path, size_t offset, size_t len,
     ssize_t bytes_read;
     int rc;
 
-    rc = fs_open(&file, path);
+    rc = fs_open(&file, path, FS_O_READ);
     if (rc != 0) {
-        return MGMT_ERR_EUNKNOWN;
+        return MGMT_ERR_ENOENT;
     }
 
     rc = fs_seek(&file, offset, FS_SEEK_SET);
@@ -123,7 +123,7 @@ fs_mgmt_impl_write(const char *path, size_t offset, const 
void *data,
         }
     }
 
-    rc = fs_open(&file, path);
+    rc = fs_open(&file, path, FS_O_CREATE | FS_O_WRITE);
     if (rc != 0) {
         return MGMT_ERR_EUNKNOWN;
     }

Reply via email to