headius / spoon

A fork/exec replacement for FFI-capable implementations
Apache License 2.0
48 stars 12 forks source link

No error handling on return code from posix_spawn #5

Closed evilrich closed 12 years ago

evilrich commented 12 years ago

Spoon performs no error handling on the return of _posixspawn. It also returns the process ID even when the spawn fails. For example:

> Spoon.spawn
 => 86511 
> Spoon.spawn('no_such_command')
 => 86529 

I have a fix for this here 9baec25d165bbb5568f378c62984c27a5d44bc6a

With this fix:

> Spoon.spawn('no_such_command')
Errno::ENOENT: No such file or directory - no_such_command
    from ./lib/spoon.rb:19:in `spawn'
headius commented 12 years ago

All good!