[MLton-commit] r6833

Wesley Terpstra wesley at mlton.org
Fri Sep 5 07:01:20 PDT 2008


Unix.reap already closes the files!
----------------------------------------------------------------------

U   mlton/trunk/lib/mlton/basic/process.sml

----------------------------------------------------------------------

Modified: mlton/trunk/lib/mlton/basic/process.sml
===================================================================
--- mlton/trunk/lib/mlton/basic/process.sml	2008-09-05 13:02:33 UTC (rev 6832)
+++ mlton/trunk/lib/mlton/basic/process.sml	2008-09-05 14:01:08 UTC (rev 6833)
@@ -379,22 +379,20 @@
 fun callWithIn (name, args, f: In.t -> 'a) =
    let
       val pid = Unix.execute (name, args)
-      val () = TextIO.closeOut (Unix.textOutstreamOf pid)
       val ins = Unix.textInstreamOf pid
    in
       Exn.finally
-      (fn () => In.withClose (ins, f),
+      (fn () => f ins,
        fn () => ignore (Unix.reap pid))
    end
 
 fun callWithOut (name, args, f: Out.t -> 'a) =
    let
       val pid = Unix.execute (name, args)
-      val () = TextIO.closeIn (Unix.textInstreamOf pid)
       val out = Unix.textOutstreamOf pid
    in
       Exn.finally
-      (fn () => Out.withClose (out, f),
+      (fn () => f out,
        fn () => ignore (Unix.reap pid))
    end
 




More information about the MLton-commit mailing list