[commit: packages/unix] master, safefixes710again: Tweak execvpe.h hack (see 256b19184bcb) some more (5986106)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 15:50:52 UTC 2015


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

On branches: master,safefixes710again
Link       : http://ghc.haskell.org/trac/ghc/changeset/59861061f2ab1d3f4b28e83d2dcc3adf0f9acb04/unix

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

commit 59861061f2ab1d3f4b28e83d2dcc3adf0f9acb04
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun Dec 7 16:01:51 2014 +0100

    Tweak execvpe.h hack (see 256b19184bcb) some more


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

59861061f2ab1d3f4b28e83d2dcc3adf0f9acb04
 cbits/execvpe.c   | 7 ++++---
 cbits/ghcrts.c    | 5 +++--
 include/execvpe.h | 5 +++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/cbits/execvpe.c b/cbits/execvpe.c
index 9599836..c27bca9 100644
--- a/cbits/execvpe.c
+++ b/cbits/execvpe.c
@@ -9,12 +9,10 @@
 
    -------------------------------------------------------------------------- */
 
-#include "execvpe.h"
+#include "HsUnixConfig.h"
 
 #if HAVE_EXECVPE
 # define _GNU_SOURCE
-#else
-# undef execvpe
 #endif
 
 #include <errno.h>
@@ -28,6 +26,9 @@
 #include <string.h>
 #include <errno.h>
 
+#define HSUNIX_EXECVPE_H_NO_COMPAT
+#include "execvpe.h"
+
 /*
  * We want the search semantics of execvp, but we want to provide our
  * own environment, like execve.  The following copyright applies to
diff --git a/cbits/ghcrts.c b/cbits/ghcrts.c
index 1e0dc1c..9003675 100644
--- a/cbits/ghcrts.c
+++ b/cbits/ghcrts.c
@@ -1,10 +1,11 @@
-#include "execvpe.h"
-
 #ifdef __GLASGOW_HASKELL__
 // for 'void StopTimer(void)' prototype
 # include "Rts.h"
 #endif
 
+#define HSUNIX_EXECVPE_H_NO_COMPAT
+#include "execvpe.h"
+
 /* Copied verbatim from ghc/lib/std/cbits/system.c. */
 void pPrPr_disableITimers (void)
 {
diff --git a/include/execvpe.h b/include/execvpe.h
index 7faa0df..1fd2fbb 100644
--- a/include/execvpe.h
+++ b/include/execvpe.h
@@ -7,12 +7,12 @@
 #ifndef HSUNIX_EXECVPE_H
 #define HSUNIX_EXECVPE_H
 
-#include "HsUnixConfig.h"
-
 extern int
 __hsunix_execvpe(const char *name, char *const argv[], char *const envp[]);
 
 // this hack is needed for `process`; to be removed in unix-2.8
+#ifndef HSUNIX_EXECVPE_H_NO_COMPAT
+#include "HsUnixConfig.h"
 #if HAVE_EXECVPE
 # define _GNU_SOURCE
 # include <unistd.h>
@@ -21,6 +21,7 @@ execvpe(const char *name, char *const argv[], char *const envp[]);
 #else
 # define execvpe(name,argv,envp) __hsunix_execvpe(name,argv,envp)
 #endif
+#endif
 
 // implemented in cbits/ghcrts.c
 extern void pPrPr_disableITimers (void);



More information about the ghc-commits mailing list