Commit a3140fb7 authored by rrt's avatar rrt
Browse files

[project @ 2001-08-30 17:22:13 by rrt]

Make it work better on windows MERGE TO STABLE BRANCH
parent fd14814f
......@@ -586,7 +586,7 @@ evalExpr (EPipe src cmd)
-- to the FFI, since ghci can't handle FFI calls right now
myMkTempName :: String -> Int -> String
myMkTempName hashable_str ctr
= "/tmp/testdriver_" ++ show (hash 0 hashable_str) ++ "_" ++ show ctr
= "testdriver_" ++ show (hash 0 hashable_str) ++ "_" ++ show ctr
where
hash :: Int -> String -> Int
hash h [] = h
......
......@@ -29,7 +29,7 @@ die :: String -> IO a
die s = do officialMsg s; exitWith (ExitFailure 1)
my_system s
= do -- putStr ("***" ++ s)
= do -- putStrLn ("***" ++ s)
exit_code <- system s
-- putStrLn "ok"
return exit_code
......
{-# OPTIONS -cpp -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- $Id: KludgedSystem.hs,v 1.1 2001/08/30 17:22:13 rrt Exp $
-- system that works feasibly under Windows (i.e. passes the command line to sh,
-- because system() under Windows doesn't look at SHELL, and always uses CMD.EXE)
module KludgedSystem (system) where
#include "../../ghc/includes/config.h"
#ifndef mingw32_TARGET_OS
import System (system)
#else
import qualified System
import System (ExitCode)
import IO (bracket_)
import Directory (removeFile)
system :: String -> IO ExitCode
system cmd = do
pid <- getProcessID
let tmp = "sh"++show pid
writeFile tmp (cmd++"\n")
bracket_ (return tmp) removeFile $ System.system ("sh - "++tmp)
foreign import "_getpid" unsafe getProcessID :: IO Int
#endif /* mingw32_TARGET_OS */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment