return ret;
}
-/**
- * A wrapper for fchdir().
- *
- * \param fd An open file descriptor.
- *
- * \return Standard.
- */
-int para_fchdir(int fd)
-{
- if (fchdir(fd) < 0)
- return -ERRNO_TO_ERROR(errno);
- return 1;
-}
-
/**
* Open a file and map it into memory.
*
int osl_open(const char *path, int flags, mode_t mode);
int para_opendir(const char *dirname, DIR **dir, int *cwd);
-int para_fchdir(int fd);
int mmap_full_file(const char *filename, int open_mode, void **map,
size_t *size, int *fd_ptr);
int osl_munmap(void *start, size_t length);
return 0;
}
+/**
+ * A wrapper for fchdir().
+ *
+ * \param fd An open file descriptor.
+ *
+ * \return Standard.
+ */
+static inline int __fchdir(int fd)
+{
+ if (fchdir(fd) < 0)
+ return -ERRNO_TO_ERROR(errno);
+ return 1;
+}
+
/**
* Traverse the given directory recursively.
*
ret = 1;
out:
closedir(dir);
- ret2 = para_fchdir(cwd_fd);
+ ret2 = __fchdir(cwd_fd);
if (ret2 < 0 && ret >= 0)
ret = ret2;
close(cwd_fd);
break;
}
closedir(dir);
- ret2 = para_fchdir(cwd_fd);
+ ret2 = __fchdir(cwd_fd);
if (ret2 < 0 && ret >= 0)
ret = ret2;
close(cwd_fd);