PARA_ERROR(INDEX_CORRUPTION, "index corruption detected"), \
PARA_ERROR(INVALID_OBJECT, "reference to invalid object"), \
PARA_ERROR(STAT, "can not stat file"), \
- PARA_ERROR(RENAME, "rename failed"), \
PARA_ERROR(WRITE, "write error"), \
PARA_ERROR(LSEEK, "lseek error"), \
PARA_ERROR(BUSY, "table is busy"), \
#define FD_ERRORS \
PARA_ERROR(FGETS, "fgets error"), \
- PARA_ERROR(OPEN, "failed to open file"), \
- PARA_ERROR(CHDIR_PERM, "insufficient permissions to chdir"), \
PARA_ERROR(EMPTY, "file empty"), \
PARA_ERROR(MMAP, "mmap error"), \
PARA_ERROR(MUNMAP, "munmap failed"), \
int cwd_fd, ret2, ret = para_opendir(dirname, &dir, &cwd_fd);
if (ret < 0)
- return ret == -E_CHDIR_PERM? 1 : ret;
+ return ret == -ERRNO_TO_PARA_ERROR(EACCES)? 1 : ret;
/* scan cwd recursively */
while ((entry = readdir(dir))) {
mode_t m;
* \param old_path The source path.
* \param new_path The destination path.
*
- * \return positive in success, \p -E_RENAME on errors.
+ * \return Standard.
*
* \sa rename(2).
*/
static inline int para_rename(const char *old_path, const char *new_path)
{
if (rename(old_path, new_path) < 0)
- return -E_RENAME;
+ return -ERRNO_TO_PARA_ERROR(errno);
return 1;
}