summaryrefslogtreecommitdiff
path: root/supervisor/shared/filesystem.c
diff options
context:
space:
mode:
authorMark <56205165+gamblor21@users.noreply.github.com>2020-10-16 15:52:45 -0500
committerGitHub <noreply@github.com>2020-10-16 15:52:45 -0500
commit8e6d3e5b91f4c7cdb0dc4743a9a9937708daa624 (patch)
tree6d541d14808bd8456b17303fb654a73300f1adc5 /supervisor/shared/filesystem.c
parent645382d51d37a40312118eebc11da75639913fce (diff)
parentf0b37313c5adf2ad940d7279aa49620d36d7292d (diff)
Merge branch 'main' into recv_into_size_check6.1.0-alpha.0
Diffstat (limited to 'supervisor/shared/filesystem.c')
-rw-r--r--supervisor/shared/filesystem.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c
index f6b94e38b..88603be0c 100644
--- a/supervisor/shared/filesystem.c
+++ b/supervisor/shared/filesystem.c
@@ -105,13 +105,19 @@ void filesystem_init(bool create_allowed, bool force_create) {
// set label
#ifdef CIRCUITPY_DRIVE_LABEL
- f_setlabel(&vfs_fat->fatfs, CIRCUITPY_DRIVE_LABEL);
+ res = f_setlabel(&vfs_fat->fatfs, CIRCUITPY_DRIVE_LABEL);
#else
- f_setlabel(&vfs_fat->fatfs, "CIRCUITPY");
+ res = f_setlabel(&vfs_fat->fatfs, "CIRCUITPY");
#endif
+ if (res != FR_OK) {
+ return;
+ }
// inhibit file indexing on MacOS
- f_mkdir(&vfs_fat->fatfs, "/.fseventsd");
+ res = f_mkdir(&vfs_fat->fatfs, "/.fseventsd");
+ if (res != FR_OK) {
+ return;
+ }
make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index");
make_empty_file(&vfs_fat->fatfs, "/.Trashes");
make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log");
@@ -119,7 +125,10 @@ void filesystem_init(bool create_allowed, bool force_create) {
make_sample_code_file(&vfs_fat->fatfs);
// create empty lib directory
- f_mkdir(&vfs_fat->fatfs, "/lib");
+ res = f_mkdir(&vfs_fat->fatfs, "/lib");
+ if (res != FR_OK) {
+ return;
+ }
// and ensure everything is flushed
supervisor_flash_flush();