[commit: packages/unix] bgamari-patch-1, master, readdirstream-maybe-patch: Fix segfault from inconsistent macro use. (748e322)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 22:04:22 UTC 2017


Repository : ssh://git@git.haskell.org/unix

On branches: bgamari-patch-1,master,readdirstream-maybe-patch
Link       : http://ghc.haskell.org/trac/ghc/changeset/748e3224e06638639a76cbc622e9b8c17054d5df/unix

>---------------------------------------------------------------

commit 748e3224e06638639a76cbc622e9b8c17054d5df
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Wed Sep 7 17:31:02 2016 -0700

    Fix segfault from inconsistent macro use.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


>---------------------------------------------------------------

748e3224e06638639a76cbc622e9b8c17054d5df
 cbits/HsUnix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cbits/HsUnix.c b/cbits/HsUnix.c
index 08cccd5..7c72a34 100644
--- a/cbits/HsUnix.c
+++ b/cbits/HsUnix.c
@@ -110,7 +110,7 @@ char *__hscore_d_name( struct dirent* d )
 
 void __hscore_free_dirent(struct dirent *dEnt)
 {
-#if HAVE_READDIR_R
+#if HAVE_READDIR_R && USE_READDIR_R
   free(dEnt);
 #endif
 }



More information about the ghc-commits mailing list