Skip to content

std: Handle DT_DIR file types in dirent pointers #25632

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

Merged
merged 1 commit into from
May 23, 2015

Conversation

alexcrichton
Copy link
Member

This "fast path" in DirEntry::file_type on Unix wasn't turning out to be so
much of a fast path as the DT_DIR case wasn't handled, so directories fell
back to using lstat instead. This commit adds the missing case to return
quickly if a path is a directory and DirEntry::file_type is used.

@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

This "fast path" in `DirEntry::file_type` on Unix wasn't turning out to be so
much of a fast path as the `DT_DIR` case wasn't handled, so directories fell
back to using `lstat` instead. This commit adds the missing case to return
quickly if a path is a directory and `DirEntry::file_type` is used.
@brson
Copy link
Contributor

brson commented May 21, 2015

@bors r+

@bors
Copy link
Collaborator

bors commented May 21, 2015

📌 Commit e7aad28 has been approved by brson

@bors
Copy link
Collaborator

bors commented May 21, 2015

⌛ Testing commit e7aad28 with merge 850b338...

@bors
Copy link
Collaborator

bors commented May 21, 2015

💔 Test failed - auto-linux-32-opt

@sfackler
Copy link
Member

@bors retry

@bors
Copy link
Collaborator

bors commented May 22, 2015

⌛ Testing commit e7aad28 with merge 9ccba72...

@bors
Copy link
Collaborator

bors commented May 22, 2015

💔 Test failed - auto-linux-64-opt

@sfackler
Copy link
Member

@bors retry

oli-obk pushed a commit to oli-obk/rust that referenced this pull request May 23, 2015
This "fast path" in `DirEntry::file_type` on Unix wasn't turning out to be so
much of a fast path as the `DT_DIR` case wasn't handled, so directories fell
back to using `lstat` instead. This commit adds the missing case to return
quickly if a path is a directory and `DirEntry::file_type` is used.
bors added a commit that referenced this pull request May 23, 2015
This "fast path" in `DirEntry::file_type` on Unix wasn't turning out to be so
much of a fast path as the `DT_DIR` case wasn't handled, so directories fell
back to using `lstat` instead. This commit adds the missing case to return
quickly if a path is a directory and `DirEntry::file_type` is used.
@bors
Copy link
Collaborator

bors commented May 23, 2015

⌛ Testing commit e7aad28 with merge d113990...

@bors bors merged commit e7aad28 into rust-lang:master May 23, 2015
@alexcrichton alexcrichton deleted the dt-dir branch July 17, 2015 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants