summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-03-13 20:17:23 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-03-13 20:17:23 -0400
commitd069e06ce669999393e5db361ac378804adbe3ba (patch)
treee19e1a4ed8b0b56b769385d073519878c63aefc7 /src/compiler.sml
parent483df3cb6dbb33bb919fc7944527b339c6f70abc (diff)
Delete C temporary directories, even if other files wind up there
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 8ee86947..2ebf0d28 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -1425,10 +1425,10 @@ fun compile job =
in
OS.FileSys.mkDir dir;
(cname, oname,
- fn () => (OS.FileSys.remove cname;
- OS.FileSys.remove oname;
- OS.FileSys.rmDir dir)
- handle OS.SysErr _ => OS.FileSys.rmDir dir)
+ fn () => (if OS.Process.isSuccess (OS.Process.system ("rm -rf " ^ dir)) then
+ ()
+ else
+ raise Fail ("Unable to delete temporary directory " ^ dir)))
end
val ename = #exe job
in