Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove subdirectory non-existence check for better compatibility with 9.0 #8863

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions shared-module/storage/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,8 @@ void common_hal_storage_mount(mp_obj_t vfs_obj, const char *mount_path, bool rea
args[0] = readonly ? mp_const_true : mp_const_false;
args[1] = mp_const_false; // Don't make the file system automatically when mounting.

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

// check that the destination mount point is unused
const char *path_out;
Expand Down
Loading