From 6b04e604ab6c912e0995074ef360030005f79e00 Mon Sep 17 00:00:00 2001 From: rrt Date: Tue, 13 Mar 2001 17:46:56 +0000 Subject: [PATCH] [project @ 2001-03-13 17:46:56 by rrt] Use TMPDIR, not /tmp. --- ghc/utils/hsc2hs/KludgedSystem.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 1.7.10.4