/*
- * (c) The University of Glasgow 1994-2003
+ * (c) The University of Glasgow 1994-2004
+ *
+ * WARNING: this file is here for backwards compatibility only. It is
+ * not included as part of the base package, but is #included into the
+ * compiler and the runghc utility when building either of these with
+ * an old version of GHC.
*
* shell-less system Runtime Support (see System.Cmd.rawSystem).
*/
/* The itimer stuff in this module is non-posix */
/* #include "PosixSource.h" */
+/* This ifdef is required because this source might be compiled by an
+ * external compiler. See ghc/utils/runghc/rawSystem.c for example.
+ */
+#ifdef __GLASGOW_HASKELL__
+#if __GLASGOW_HASKELL__ < 603
#include "config.h"
+#else
+#include "ghcconfig.h"
+#endif
+#endif
#include <stdio.h>
#include <stdlib.h>
Since we are going to wait for the process to terminate anyway,
there is no problem with such sharing. */
+ errno = EINVAL; // ToDo: wrong, caller should use GetLastError()
return -1;
}
WaitForSingleObject(pInfo.hProcess, INFINITE);
- if (GetExitCodeProcess(pInfo.hProcess, &retCode) == 0) return -1;
+ if (GetExitCodeProcess(pInfo.hProcess, &retCode) == 0) {
+ errno = EINVAL; // ToDo: wrong, caller should use GetLastError()
+ return -1;
+ }
CloseHandle(pInfo.hProcess);
CloseHandle(pInfo.hThread);