return -ERRNO_TO_PARA_ERROR(errno);
}
-/**
- * Wrapper for chdir(2).
- *
- * \param path The specified directory.
- *
- * \return Standard.
- */
-int para_chdir(const char *path)
-{
- int ret = chdir(path);
-
- if (ret >= 0)
- return 1;
- return -ERRNO_TO_PARA_ERROR(errno);
-}
-
/**
* Save the cwd and open a given directory.
*
return ret;
*cwd = ret;
}
- ret = para_chdir(dirname);
- if (ret < 0)
+ if (chdir(dirname) != 0) {
+ ret = -ERRNO_TO_PARA_ERROR(errno);
goto close_cwd;
+ }
*dir = opendir(".");
if (*dir)
return 1;