From 3715aa127c51cbcae87af34c088e013d56cb128f Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 21 Jan 2011 05:03:21 +0000 Subject: Deleted the former Process code in the compiler. things which used it to use sys.process. No review. --- src/compiler/scala/tools/nsc/CompileSocket.scala | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/compiler/scala/tools/nsc/CompileSocket.scala') diff --git a/src/compiler/scala/tools/nsc/CompileSocket.scala b/src/compiler/scala/tools/nsc/CompileSocket.scala index 570066327f..cba1ce132e 100644 --- a/src/compiler/scala/tools/nsc/CompileSocket.scala +++ b/src/compiler/scala/tools/nsc/CompileSocket.scala @@ -11,9 +11,10 @@ import java.util.regex.Pattern import java.net._ import java.security.SecureRandom -import io.{ File, Path, Process, Socket } +import io.{ File, Path, Socket } import scala.util.control.Exception.catching import scala.tools.util.StringOps.splitWhere +import scala.sys.process._ /** This class manages sockets for the fsc offline compiler. */ class CompileSocket { @@ -47,7 +48,7 @@ class CompileSocket { protected def fatal(msg: String) = { fscError(msg) - throw new Exception("fsc failure") + sys.error("fsc failure") } protected def info(msg: String) = @@ -82,12 +83,10 @@ class CompileSocket { Seq(vmCommand) ++ vmArgs ++ Seq(serverClass) filterNot (_ == "") /** Start a new server; returns true iff it succeeds */ - private def startNewServer(vmArgs: String) { + private def startNewServer(vmArgs: String) = { val cmd = serverCommand(vmArgs split " " toSeq) - info("[Executed command: %s]" format cmd) - try Process exec cmd catch { - case ex: IOException => fatal("Cannot start compilation daemon.\ntried command: %s" format cmd) - } + info("[Executing command: %s]" format cmd) + (cmd.! == 0) || fatal("Cannot start compilation daemon.\ntried command: %s" format cmd) } /** The port identification file */ -- cgit v1.2.3