[riot-notifications] [RIOT-OS/RIOT] pkg/fatfs/fatfs_vfs: fix flag translation in _open (#14175)

sven-hm notifications at github.com
Fri May 29 20:12:26 CEST 2020


@sven-hm commented on this pull request.



> +static void test_newlib(void)
+{
+    FILE* fl;
+    char buf[sizeof(test_txt) + sizeof(test_txt2)];
+    print_test_result("test_newlib__mount", vfs_mount(&_test_vfs_mount) == 0);
+
+    /* try to open file that doesn't exist */
+    fl = fopen(FULL_FNAME_NXIST, "r");
+    print_test_result("test_newlib__fopen", fl == NULL);
+    if (fl) {
+        fclose(fl);
+    }
+
+    /* open file RO */
+    fl = fopen(FULL_FNAME1, "r");
+    print_test_result("test_newlib__fopen_r", fl != NULL);

Hmm, i'm wondering if in `test_create` `vfs_open` with ` O_WRONLY | O_CREAT` should be successful if  the file already exists? Shouldn't there be `O_TRUNC` added?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14175#discussion_r432654919
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200529/752826ff/attachment.htm>


More information about the notifications mailing list