diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-21 05:03:21 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-21 05:03:21 +0000 |
commit | 3715aa127c51cbcae87af34c088e013d56cb128f (patch) | |
tree | c3d7b90ff4becc81ee357e2e8e6a5d60aa3fd4fe /src/compiler/scala/tools/nsc/CompileSocket.scala | |
parent | d8dfb6ec6334bfbf4f78fd97b8af2de8441cf7db (diff) | |
download | scala-3715aa127c51cbcae87af34c088e013d56cb128f.tar.gz scala-3715aa127c51cbcae87af34c088e013d56cb128f.tar.bz2 scala-3715aa127c51cbcae87af34c088e013d56cb128f.zip |
Deleted the former Process code in the compiler.
things which used it to use sys.process. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/CompileSocket.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/CompileSocket.scala | 13 |
1 files changed, 6 insertions, 7 deletions
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 */ |