summaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-06-06 21:04:47 +0200
committerYorhel <git@yorhel.nl>2009-06-06 21:04:47 +0200
commit21f2e627937176cd857cab25c481bb0b7d8cf60f (patch)
tree4121846a66d569a539da96e3653bde3dfdec8e52 /src/path.c
parente5dccc1719a87b045373561d0566e3a12bc01cef (diff)
Removed another occurence of dirfd()
This fixes a tiny memory leak as well, as the return value of opendir() wasn't passed to a closedir() after use.
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/path.c b/src/path.c
index 949065b..4894f02 100644
--- a/src/path.c
+++ b/src/path.c
@@ -212,10 +212,6 @@ char *path_real(const char *orig) {
int path_chdir(const char *path) {
char **arr, *cur;
int i, r = -1;
- DIR *d;
-
- if((d = opendir(".")) == NULL)
- return -1;
if((cur = path_absolute(path)) == NULL)
return -1;
@@ -229,8 +225,6 @@ int path_chdir(const char *path) {
r = 0;
path_chdir_done:
- if(r < 0)
- fchdir(dirfd(d));
free(cur);
free(arr);
return r;