fixed a bug with waitpid() - I'd forgotten about WEXITSTATUS !