Usermode/libc - Fixing errors from clang, disabled heap for native build
[tpg/acess2.git] / Usermode / Libraries / libposix.so_src / dirent.c
index 5722aa4..920020a 100644 (file)
@@ -24,9 +24,10 @@ DIR *fdopendir(int fd)
        if( _SysFInfo(fd, &info, 0) != 0 )
                return NULL;
 
-       
-
-       return NULL;
+       DIR     *ret = malloc(sizeof(DIR));
+       ret->fd = fd;
+       ret->pos = 0;
+       return ret;
 }
 
 DIR *opendir(const char *name)
@@ -48,6 +49,8 @@ int closedir(DIR *dp)
                errno = EINVAL;
                return -1;
        }
+       _SysClose(dp->fd);
+       free(dp);
        return 0;
 }
 

UCC git Repository :: git.ucc.asn.au