ret = para_chdir(dirname);
if (ret < 0)
goto close_cwd;
- ret = -E_OPENDIR;
*dir = opendir(".");
- if (!*dir)
- goto change_to_orig_dir;
- return 1;
+ if (*dir)
+ return 1;
+ ret = -ERRNO_TO_PARA_ERROR(errno);
/* Ignore return value of fchdir() and close(). We're busted anyway. */
change_to_orig_dir:
if (cwd)