sunfishcode / c-ward

An implementation of libc written in Rust
Other
187 stars 11 forks source link

Don't panic if /var/run/utmp is missing #136

Closed pothos closed 3 months ago

pothos commented 3 months ago
pothos commented 3 months ago

Tested it and it doesn't panic anymore as wanted. Reading the glibc code I don't see errno being set up for this case. I will remove set_errno(Errno(libc::ENOENT)); and maybe I think we should also skip setting errno. Or we could use set_errno(Errno(0)) to make this explicit.

pothos commented 3 months ago

Thanks for the test! I've switched back to my initial version which was to set ENOENT. The man page also says: On failure, these functions errno set to indicate the error.

sunfishcode commented 3 months ago

Thanks!

sunfishcode commented 3 months ago

This is now released in c-gull 0.16.1.