summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
09156a3)
Return the system error code instead.
#define FD_ERRORS \
PARA_ERROR(FGETS, "fgets error"), \
PARA_ERROR(CHDIR, "failed to change directory"), \
#define FD_ERRORS \
PARA_ERROR(FGETS, "fgets error"), \
PARA_ERROR(CHDIR, "failed to change directory"), \
- PARA_ERROR(FCHDIR, "fchdir failed"), \
PARA_ERROR(OPEN, "failed to open file"), \
PARA_ERROR(CHDIR_PERM, "insufficient permissions to chdir"), \
PARA_ERROR(OPEN, "failed to open file"), \
PARA_ERROR(CHDIR_PERM, "insufficient permissions to chdir"), \
* \param dir Result pointer.
* \param cwd File descriptor of the current working directory.
*
* \param dir Result pointer.
* \param cwd File descriptor of the current working directory.
*
- * \return Positive on success, negative on errors.
*
* Opening the current directory (".") and calling fchdir() to return is
* usually faster and more reliable than saving cwd in some buffer and calling
*
* Opening the current directory (".") and calling fchdir() to return is
* usually faster and more reliable than saving cwd in some buffer and calling
*
* \param fd An open file descriptor
*
*
* \param fd An open file descriptor
*
- * \return Positive on success, negative on errors.
*/
int para_fchdir(int fd)
{
if (fchdir(fd) < 0)
*/
int para_fchdir(int fd)
{
if (fchdir(fd) < 0)
+ return -ERRNO_TO_PARA_ERROR(errno);