summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/CompileSocket.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-21 05:03:21 +0000
committerPaul Phillips <paulp@improving.org>2011-01-21 05:03:21 +0000
commit3715aa127c51cbcae87af34c088e013d56cb128f (patch)
treec3d7b90ff4becc81ee357e2e8e6a5d60aa3fd4fe /src/compiler/scala/tools/nsc/CompileSocket.scala
parentd8dfb6ec6334bfbf4f78fd97b8af2de8441cf7db (diff)
downloadscala-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.scala13
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 */