summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/CompileClient.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-04-27 18:35:47 +0000
committerPaul Phillips <paulp@improving.org>2011-04-27 18:35:47 +0000
commit1a443ebb205a2e79951d212567fca0d7bd7dcd7e (patch)
tree0bf0281ecc991cd3a56950c84fa1fa03feb4793b /src/compiler/scala/tools/nsc/CompileClient.scala
parent6d653c3d07b31b160cf9444b06d9fe91fc32651a (diff)
downloadscala-1a443ebb205a2e79951d212567fca0d7bd7dcd7e.tar.gz
scala-1a443ebb205a2e79951d212567fca0d7bd7dcd7e.tar.bz2
scala-1a443ebb205a2e79951d212567fca0d7bd7dcd7e.zip
Fixed inversion of fsc's exit code, closes #451...
Fixed inversion of fsc's exit code, closes #4519 no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/CompileClient.scala')
-rw-r--r--src/compiler/scala/tools/nsc/CompileClient.scala9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/CompileClient.scala b/src/compiler/scala/tools/nsc/CompileClient.scala
index fd4f777890..dc65bf780e 100644
--- a/src/compiler/scala/tools/nsc/CompileClient.scala
+++ b/src/compiler/scala/tools/nsc/CompileClient.scala
@@ -19,7 +19,7 @@ class StandardCompileClient extends HasCompileSocket with CompileOutputCommon {
val versionMsg = "Fast " + Properties.versionMsg
var verbose = false
- def process(args: Array[String]): Int = {
+ def process(args: Array[String]): Boolean = {
// Trying to get out in front of the log messages in case we're
// going from verbose to not verbose.
verbose = (args contains "-verbose")
@@ -34,7 +34,7 @@ class StandardCompileClient extends HasCompileSocket with CompileOutputCommon {
if (settings.version.value) {
Console println versionMsg
- return 0
+ return true
}
info(versionMsg)
@@ -46,7 +46,7 @@ class StandardCompileClient extends HasCompileSocket with CompileOutputCommon {
if (settings.server.value == "") compileSocket.getOrCreateSocket(vmArgs mkString " ", !shutdown)
else Some(compileSocket.getSocket(settings.server.value))
- val success = socket match {
+ socket match {
case Some(sock) => compileOnServer(sock, fscArgs)
case _ =>
echo(
@@ -55,13 +55,12 @@ class StandardCompileClient extends HasCompileSocket with CompileOutputCommon {
)
shutdown
}
- if (success) 1 else 0
}
}
object CompileClient extends StandardCompileClient {
def main(args: Array[String]): Unit = sys exit {
- try process(args)
+ try { if (process(args)) 0 else 1 }
catch { case _: Exception => 1 }
}
}