Check return value from waitpid call in command*() functions.