rust-random / getrandom

A small cross-platform library for retrieving random data from (operating) system source
Apache License 2.0
264 stars 166 forks source link

Solaris: Do not read from errno when libc did not indicate error. #448

Closed briansmith closed 1 month ago

briansmith commented 1 month ago

errno is only guaranteed to be set correctly when the function's return value indicates that the function failed. Handle the case where an unexpected negative result is returned separately from the case where the function failed.