You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/04/18 02:32:47 UTC

[GitHub] ccollins476ad closed pull request #1034: fsutil_write_file: open the file, truncating if it exists

ccollins476ad closed pull request #1034: fsutil_write_file: open the file, truncating if it exists
URL: https://github.com/apache/mynewt-core/pull/1034
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/fs/fs/src/fsutil.c b/fs/fs/src/fsutil.c
index 7fc97d16a..81e83e9ba 100644
--- a/fs/fs/src/fsutil.c
+++ b/fs/fs/src/fsutil.c
@@ -49,7 +49,7 @@ fsutil_write_file(const char *path, const void *data, uint32_t len)
     struct fs_file *file;
     int rc;
 
-    rc = fs_open(path, FS_ACCESS_WRITE, &file);
+    rc = fs_open(path, FS_ACCESS_WRITE | FS_ACCESS_TRUNCATE, &file);
     if (rc != 0) {
         return rc;
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services