Skip to content

Commit a547575

Browse files
committed
Return error when attempting to open a file multiple times
1 parent b10a70c commit a547575

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/volume_mgr.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,12 @@ where
412412
_ => return Err(Error::FileNotFound),
413413
};
414414

415+
if let Some(d) = &dir_entry {
416+
if cluster_already_open(&self.open_files, volume.idx, d.cluster) {
417+
return Err(Error::FileAlreadyOpen);
418+
}
419+
}
420+
415421
let mode = solve_mode_variant(mode, dir_entry.is_some());
416422

417423
match mode {

0 commit comments

Comments
 (0)