[commit: packages/unix] master, safefixes710again: Have "execvpe.h" provide execvpe() again (7bad9d7)
git at git.haskell.org
git at git.haskell.org
Thu Mar 19 15:50:46 UTC 2015
Repository : ssh://git@git.haskell.org/unix
On branches: master,safefixes710again
Link : http://ghc.haskell.org/trac/ghc/changeset/7bad9d7d52d24cc4246646e5af3116c2dd8c25c4/unix
>---------------------------------------------------------------
commit 7bad9d7d52d24cc4246646e5af3116c2dd8c25c4
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Sat Dec 6 21:11:59 2014 +0100
Have "execvpe.h" provide execvpe() again
Turns out `process` reuses `unix`'s execvpe() implementation,
and the refactoring in f24ba78f68b2cbc4f4afadc8dd60fc2935357255
broke process.
>---------------------------------------------------------------
7bad9d7d52d24cc4246646e5af3116c2dd8c25c4
cbits/execvpe.c | 5 +++--
include/execvpe.h | 15 +++++++++++++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/cbits/execvpe.c b/cbits/execvpe.c
index b4f9472..9599836 100644
--- a/cbits/execvpe.c
+++ b/cbits/execvpe.c
@@ -8,12 +8,13 @@
execvpe(3) is available, we use that instead.
-------------------------------------------------------------------------- */
-#include "execvpe.h"
-#include "HsUnixConfig.h"
+#include "execvpe.h"
#if HAVE_EXECVPE
# define _GNU_SOURCE
+#else
+# undef execvpe
#endif
#include <errno.h>
diff --git a/include/execvpe.h b/include/execvpe.h
index 1d49e35..d4b6521 100644
--- a/include/execvpe.h
+++ b/include/execvpe.h
@@ -4,8 +4,23 @@
Interface for code in cbits/execvpe.c
------------------------------------------------------------------------- */
+#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
+#if HAVE_EXECVPE
+# define _GNU_SOURCE
+# include <unistd.h>
+#else
+# define execvpe(name,argv,envp) __hsunix_execvpe(name,argv,envp)
+#endif
+
// implemented in cbits/ghcrts.c
extern void pPrPr_disableITimers (void);
+
+#endif
More information about the ghc-commits
mailing list