Skip to content

Commit 7af7517

Browse files
authored
Merge pull request #8863 from jepler/mount-point-check-82x
remove subdirectory non-existence check for better compatibility with 9.0
2 parents 4d2b983 + df1eada commit 7af7517

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

shared-module/storage/__init__.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,8 @@ void common_hal_storage_mount(mp_obj_t vfs_obj, const char *mount_path, bool rea
178178
args[0] = readonly ? mp_const_true : mp_const_false;
179179
args[1] = mp_const_false; // Don't make the file system automatically when mounting.
180180

181-
// Check that there's no file or directory with the same name as the mount point.
182-
// But it's ok to mount '/' in any case.
183-
if (strcmp(vfs->str, "/") != 0) {
184-
nlr_buf_t nlr;
185-
if (nlr_push(&nlr) == 0) {
186-
common_hal_os_stat(mount_path);
187-
nlr_pop();
188-
// Something with the same name exists.
189-
mp_raise_OSError(MP_EEXIST);
190-
}
191-
}
181+
// 8.2.x: no check for existence of mount point, to ease the 8.2.x -> 9 transition
182+
// 9: will require existence of mount point as directory
192183

193184
// check that the destination mount point is unused
194185
const char *path_out;

0 commit comments

Comments
 (0)