diff options
author | rrt <unknown> | 2001-03-13 17:46:56 +0000 |
---|---|---|
committer | rrt <unknown> | 2001-03-13 17:46:56 +0000 |
commit | 6b04e604ab6c912e0995074ef360030005f79e00 (patch) | |
tree | 478426517026f1f07a20133e4f59ab2f6ac8d6b6 /ghc/utils | |
parent | f330fee424701042ba42ae3a02aa04c9be21f562 (diff) | |
download | haskell-6b04e604ab6c912e0995074ef360030005f79e00.tar.gz |
[project @ 2001-03-13 17:46:56 by rrt]
Use TMPDIR, not /tmp.
Diffstat (limited to 'ghc/utils')
-rw-r--r-- | ghc/utils/hsc2hs/KludgedSystem.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ghc/utils/hsc2hs/KludgedSystem.hs b/ghc/utils/hsc2hs/KludgedSystem.hs index 04bbd7374d..4794ee8301 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) |