Additional PR feedback changes.

* Add more comments.
* Use `contains` from bitflags.
* Format wasi-test source.
* Remove permission check from Windows `path_open` impl.
This commit is contained in:
Peter Huene
2020-01-09 14:09:56 -08:00
committed by Dan Gohman
parent 1c4c78ab03
commit 4b7677e4da
3 changed files with 18 additions and 18 deletions

View File

@@ -436,6 +436,8 @@ pub fn query_mode_information(handle: RawHandle) -> Result<FileModeInformation>
}
pub fn reopen_file(handle: RawHandle, access_mode: AccessMode, flags: Flags) -> Result<RawHandle> {
// Files on Windows are opened with DELETE, READ, and WRITE share mode by default (see OpenOptions in stdlib)
// This keeps the same share mode when reopening the file handle
let new_handle = unsafe {
winbase::ReOpenFile(
handle,