fixed dup2 return value