Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Windows: skip GetFileAttributes call when opening a file
Browse files Browse the repository at this point in the history
It wasn't working, and everything seemed to work fine nonetheless. Removing it just saves a syscall.
  • Loading branch information
piscisaureus committed May 10, 2012
1 parent cb58a56 commit bc4126b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/win/fs.c
Expand Up @@ -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,
Expand Down

0 comments on commit bc4126b

Please sign in to comment.