fix checking for dup2error