nix-rust / nix

Rust friendly bindings to *nix APIs
MIT License
2.67k stars 667 forks source link

Fix incorrect posix_spawn* error checking #2513

Open kosayoda opened 2 months ago

kosayoda commented 2 months ago

The posix_spawn functions do not use -1 as the sentinel for errors, rather 0 is return on success and every other return value is an error.

Adds a test case to test posix_spawn failure.

Checklist:

SteveLauC commented 2 months ago

Thanks for catching it!