size increase

Stephen Weeks MLton@sourcelight.com
Tue, 9 Apr 2002 12:29:19 -0700


> callWithIn used fork, and hence did not work on Cygwin.  I'll think
> about a workaround.

One possible workaround is to just eliminate the signals from
OS.Process.system.  That is, change it from

      fun system cmd =
	 let
	    val pid =
	       MLton.Process.spawn {path = "/bin/sh",
				    args = ["sh", "-c", cmd]}
	    val old =
	       List.map (fn s => 
			 let
			    val old = Signal.getHandler s
			    val _ = Signal.ignore s
			 in (s, old)
			 end)
	       [Signal.int, Signal.quit]
	 in
	    DynamicWind.wind (fn () => wait pid,
			      fn () => List.app Signal.setHandler old)
	 end

to

      fun system cmd =
	 let
	    val pid =
	       MLton.Process.spawn {path = "/bin/sh",
				    args = ["sh", "-c", cmd]}
	 in
	    wait pid
	 end

I tried a round of self compiles with that and it worked fine.  The
only reason that the signal stuff was there is because that's how
SML/NJ did it.  Anybody know any reason for keeping it?  The user of
OS.Process.system could always do the signal wrapping himself if he
needs it.