From: rrt Date: Tue, 13 Mar 2001 17:46:56 +0000 (+0000) Subject: [project @ 2001-03-13 17:46:56 by rrt] X-Git-Tag: Approximately_9120_patches~2422 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6b04e604ab6c912e0995074ef360030005f79e00;p=ghc-hetmet.git [project @ 2001-03-13 17:46:56 by rrt] Use TMPDIR, not /tmp. --- diff --git a/ghc/utils/hsc2hs/KludgedSystem.hs b/ghc/utils/hsc2hs/KludgedSystem.hs index 04bbd73..4794ee8 100644 --- a/ghc/utils/hsc2hs/KludgedSystem.hs +++ b/ghc/utils/hsc2hs/KludgedSystem.hs @@ -1,6 +1,6 @@ {-# OPTIONS -cpp -fglasgow-exts #-} ----------------------------------------------------------------------------- --- $Id: KludgedSystem.hs,v 1.2 2001/02/13 15:53:10 qrczak Exp $ +-- $Id: KludgedSystem.hs,v 1.3 2001/03/13 17:46:56 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) @@ -22,11 +22,13 @@ import qualified System import System (ExitCode) import IO (bracket_) import Directory (removeFile) +import Config system :: String -> IO ExitCode system cmd = do pid <- getProcessID - let tmp = "/tmp/sh"++show pid + tmp_dir <- readIORef v_TmpDir + let tmp = tmp_dir++"/sh"++show pid writeFile tmp (cmd++"\n") bracket_ (return tmp) removeFile $ System.system ("sh - "++tmp)