From 8d62f0218fee393fb1a13636935ae3ce89056555 Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 4 Jan 2002 23:21:18 +0000 Subject: [PATCH] [project @ 2002-01-04 23:21:18 by sof] prel_readdir: tidied --- ghc/lib/std/cbits/dirUtils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ghc/lib/std/cbits/dirUtils.c b/ghc/lib/std/cbits/dirUtils.c index c61d730..604a911 100644 --- 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) { + 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 ((struct dirent**)pDirEnt == NULL) { + if (pDirE == NULL) { 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); - res = readdir_r((DIR*)dirPtr, p, (struct dirent**)pDirEnt); + res = readdir_r((DIR*)dirPtr, p, pDirE); if (res != 0) { - *pDirEnt = NULL; + *pDirE = NULL; free(p); } return res; #else - struct dirent **pDirE = (struct dirent**)pDirEnt; if (pDirE == NULL) { return -1; -- 1.7.10.4