* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34292 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,39 +1,28 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2006, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2002-2009, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <syscalls.h>
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <syscalls.h>
|
||||||
#define RETURN_AND_SET_ERRNO(err) \
|
#include <syscall_utils.h>
|
||||||
if (err < 0) { \
|
|
||||||
errno = err; \
|
|
||||||
return -1; \
|
|
||||||
} \
|
|
||||||
return err;
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
chdir(const char *path)
|
chdir(const char *path)
|
||||||
{
|
{
|
||||||
int status = _kern_setcwd(-1, path);
|
RETURN_AND_SET_ERRNO(_kern_setcwd(-1, path));
|
||||||
|
|
||||||
RETURN_AND_SET_ERRNO(status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
fchdir(int fd)
|
fchdir(int fd)
|
||||||
{
|
{
|
||||||
int status = _kern_setcwd(fd, NULL);
|
RETURN_AND_SET_ERRNO(_kern_setcwd(fd, NULL));
|
||||||
|
|
||||||
RETURN_AND_SET_ERRNO(status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -68,8 +57,6 @@ getcwd(char *buffer, size_t size)
|
|||||||
int
|
int
|
||||||
rmdir(const char *path)
|
rmdir(const char *path)
|
||||||
{
|
{
|
||||||
int status = _kern_remove_dir(-1, path);
|
RETURN_AND_SET_ERRNO(_kern_remove_dir(-1, path));
|
||||||
|
|
||||||
RETURN_AND_SET_ERRNO(status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user