X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibposix.so_src%2Fdirent.c;h=e721a4f0be22cf15a18ebc069479a4aaed922827;hb=9b09b24a5cc3dfb0cee51e0d1876c9253894666a;hp=5722aa458074d8d0b92d6eef5894d382430387e8;hpb=df8ced739e79757e9c96bd8ae184f0857574c0d6;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libposix.so_src/dirent.c b/Usermode/Libraries/libposix.so_src/dirent.c index 5722aa45..e721a4f0 100644 --- a/Usermode/Libraries/libposix.so_src/dirent.c +++ b/Usermode/Libraries/libposix.so_src/dirent.c @@ -9,6 +9,7 @@ #include // NULL #include #include +#include struct DIR_s { @@ -24,9 +25,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 +50,8 @@ int closedir(DIR *dp) errno = EINVAL; return -1; } + _SysClose(dp->fd); + free(dp); return 0; }