projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6f57245
)
[project @ 2002-01-04 23:21:18 by sof]
author
sof
<unknown>
Fri, 4 Jan 2002 23:21:18 +0000
(23:21 +0000)
committer
sof
<unknown>
Fri, 4 Jan 2002 23:21:18 +0000
(23:21 +0000)
prel_readdir: tidied
ghc/lib/std/cbits/dirUtils.c
patch
|
blob
|
history
diff --git
a/ghc/lib/std/cbits/dirUtils.c
b/ghc/lib/std/cbits/dirUtils.c
index
c61d730
..
604a911
100644
(file)
--- a/
ghc/lib/std/cbits/dirUtils.c
+++ b/
ghc/lib/std/cbits/dirUtils.c
@@
-76,13
+76,14
@@
HsInt prel_end_of_dir()
HsInt
prel_readdir(HsAddr dirPtr, HsAddr pDirEnt)
{
HsInt
prel_readdir(HsAddr dirPtr, HsAddr pDirEnt)
{
+ struct dirent **pDirE = (struct dirent**)pDirEnt;
#if HAVE_READDIR_R
struct dirent* p;
struct dirent* r;
int res;
static unsigned int nm_max = -1;
#if HAVE_READDIR_R
struct dirent* p;
struct dirent* r;
int res;
static unsigned int nm_max = -1;
- if ((struct dirent**)pDirEnt == NULL) {
+ if (pDirE == NULL) {
return -1;
}
if (nm_max == -1) {
return -1;
}
if (nm_max == -1) {
@@
-95,14
+96,13
@@
prel_readdir(HsAddr dirPtr, HsAddr pDirEnt)
#endif
}
p = (struct dirent*)malloc(sizeof(struct dirent) + nm_max);
#endif
}
p = (struct dirent*)malloc(sizeof(struct dirent) + nm_max);
- res = readdir_r((DIR*)dirPtr, p, (struct dirent**)pDirEnt);
+ res = readdir_r((DIR*)dirPtr, p, pDirE);
if (res != 0) {
if (res != 0) {
- *pDirEnt = NULL;
+ *pDirE = NULL;
free(p);
}
return res;
#else
free(p);
}
return res;
#else
- struct dirent **pDirE = (struct dirent**)pDirEnt;
if (pDirE == NULL) {
return -1;
if (pDirE == NULL) {
return -1;