Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
a3140fb7
Commit
a3140fb7
authored
Aug 30, 2001
by
rrt
Browse files
[project @ 2001-08-30 17:22:13 by rrt]
Make it work better on windows MERGE TO STABLE BRANCH
parent
fd14814f
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/driver/CmdSemantics.hs
View file @
a3140fb7
...
...
@@ -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
...
...
testsuite/driver/CmdSyntax.hs
View file @
a3140fb7
...
...
@@ -29,7 +29,7 @@ die :: String -> IO a
die
s
=
do
officialMsg
s
;
exitWith
(
ExitFailure
1
)
my_system
s
=
do
-- putStr ("***" ++ s)
=
do
-- putStr
Ln
("***" ++ s)
exit_code
<-
system
s
-- putStrLn "ok"
return
exit_code
...
...
testsuite/driver/KludgedSystem.hs
0 → 100644
View file @
a3140fb7
{-# 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
*/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment