From f24ba78f68b2cbc4f4afadc8dd60fc2935357255 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Sat, 6 Dec 2014 15:39:12 +0100 Subject: Refactor local `execvpe(3)` implementation The previous code was prone to conflicts with when the platform happens to expose a `execvpe(3)` implementation in its libc. This commit renames the internal implementation to `__hsunix_execvpe` as well as adding an autoconf-detection for the presence of `execvpe(3)`, in which case `__hsunix_execvpe()` forwards the call to `execvpe(3)`. Moreover, the code has been cleaned up to remove likely bitrotted CPP conditionals. This should fix #22 (This also partially addresses #11 on platforms which have a libc-provided `execvpe(3)`) --- include/execvpe.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/execvpe.h b/include/execvpe.h index c3b2dd3..1d49e35 100644 --- a/include/execvpe.h +++ b/include/execvpe.h @@ -1,27 +1,11 @@ /* ---------------------------------------------------------------------------- (c) The University of Glasgow 2004 - Interface for code in execvpe.c + Interface for code in cbits/execvpe.c ------------------------------------------------------------------------- */ -#include "HsUnixConfig.h" -// Otherwise these clash with similar definitions from other packages: -#undef PACKAGE_BUGREPORT -#undef PACKAGE_NAME -#undef PACKAGE_STRING -#undef PACKAGE_TARNAME -#undef PACKAGE_VERSION +extern int +__hsunix_execvpe(const char *name, char *const argv[], char *const envp[]); -#include -#include -#if HAVE_SYS_WAIT_H -#include -#endif - -#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_WIN32) -#ifndef __QNXNTO__ -extern int execvpe(char *name, char *const argv[], char **envp); -#endif +// implemented in cbits/ghcrts.c extern void pPrPr_disableITimers (void); -#endif - -- cgit v1.2.3