-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Replace readdir_r call in TimeZoneInfo.Unix #116119
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces the legacy readdir_r code with the newer FileSystemEnumerable API for enumerating time zone files in Unix, while also cleaning up some static field names and unused variables in the test suite.
- Renames a static byte array field in TimeZoneInfoTests.cs to follow static naming conventions.
- Removes an unused local variable in TimeZoneInfoTests.Common.cs.
- Replaces a custom recursive directory enumeration with FileSystemEnumerable in TimeZoneInfo.Unix.NonAndroid.cs.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs | Renamed static field and updated test usages accordingly. |
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.Common.cs | Removed an unused local variable. |
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.NonAndroid.cs | Replaced readdir_r-based enumeration with FileSystemEnumerable; review the return logic in FindTimeZoneId. |
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.NonAndroid.cs
Show resolved
Hide resolved
Tagging subscribers to this area: @dotnet/area-system-datetime |
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs
Show resolved
Hide resolved
/azp run runtime-androidemulator |
/azp run runtime-ioslike,runtime-ioslikesimulator,runtime-maccatalyst |
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Pipelines successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Left small change request in the test. Also, ensure the added test is passing in all platforms including mobile and browser platforms. I enabled the mobile legs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice cleanup @jozkee ! LGTM
/ba-g I have no idea how to proceed with the error on HostActivation.Tests (there's no console log), but its clearly unrelated. |
Found this while investigating something else. It's possible System.IO was not initially used because the assembly was just folded into System.PrivateCoreLib (#53231) when the change to TimeZoneInfo was made 46d9b31.