Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Windows: skip GetFileAttributes call when opening a file

It wasn't working, and everything seemed to work fine nonetheless. Removing it just saves a syscall.
  • Loading branch information...
commit bc4126bfaae6b161a961a2b18d2bc911d4685824 1 parent cb58a56
@piscisaureus piscisaureus authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/win/fs.c
View
6 src/win/fs.c
@@ -248,10 +248,8 @@ void fs__open(uv_fs_t* req, const wchar_t* path, int flags, int mode) {
goto end;
}
- /* Figure out whether path is a file or a directory. */
- if (GetFileAttributesW(path) & FILE_ATTRIBUTE_DIRECTORY) {
- attributes |= FILE_FLAG_BACKUP_SEMANTICS;
- }
+ /* Setting this flag makes it possible to open a directory. */
+ attributes |= FILE_FLAG_BACKUP_SEMANTICS;
file = CreateFileW(path,
access,
Please sign in to comment.
Something went wrong with that request. Please try again.