git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Externals/freetype - Fix for cross-compiler
[tpg/acess2.git]
/
Usermode
/
Libraries
/
libposix.so_src
/
dirent.c
diff --git
a/Usermode/Libraries/libposix.so_src/dirent.c
b/Usermode/Libraries/libposix.so_src/dirent.c
index
5722aa4
..
e721a4f
100644
(file)
--- a/
Usermode/Libraries/libposix.so_src/dirent.c
+++ b/
Usermode/Libraries/libposix.so_src/dirent.c
@@
-9,6
+9,7
@@
#include <stddef.h> // NULL
#include <acess/sys.h>
#include <errno.h>
#include <stddef.h> // NULL
#include <acess/sys.h>
#include <errno.h>
+#include <stdlib.h>
struct DIR_s
{
struct DIR_s
{
@@
-24,9
+25,10
@@
DIR *fdopendir(int fd)
if( _SysFInfo(fd, &info, 0) != 0 )
return NULL;
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)
}
DIR *opendir(const char *name)
@@
-48,6
+50,8
@@
int closedir(DIR *dp)
errno = EINVAL;
return -1;
}
errno = EINVAL;
return -1;
}
+ _SysClose(dp->fd);
+ free(dp);
return 0;
}
return 0;
}
UCC
git Repository :: git.ucc.asn.au