-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #34776 - cuviper:solaris-readdir, r=alexcrichton
std: fix `readdir` errors for solaris A `NULL` from `readdir` could be the end of stream or an error. The only way to know is to check `errno`, so it must be set to a known value first, like a 0 that POSIX will never use. This currently only matters for solaris targets, as the other unix platforms are using `readdir_r` with a direct error return indication. However, this is getting deprecated (#34668) so they should all eventually switch to `readdir`. This PR adds `set_errno`, uses it to clear the value before calling `readdir`, then checks it again after to see the reason for a `NULL`. A few other small fixes are included just to get solaris compiling at all. I couldn't get cross-compilation completely going, so I don't have a good way to test this beyond a smoke-test cargo build of std. I'd appreciate input from someone more familiar with solaris -- cc @nbaksalyar?
- Loading branch information
Showing
5 changed files
with
41 additions
and
23 deletions.
There are no files selected for viewing
Submodule liblibc
updated
36 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters