proper return code for timeout (amending f868f12f9419);
authorwenzelm
Thu, 25 Feb 2016 00:27:57 +0100
changeset 62405 d653532762e4
parent 62404 13a0f537e232
child 62406 b5b8fb87447a
proper return code for timeout (amending f868f12f9419);
src/Pure/System/process_result.scala
src/Pure/Tools/build.scala
--- a/src/Pure/System/process_result.scala	Thu Feb 25 00:18:48 2016 +0100
+++ b/src/Pure/System/process_result.scala	Thu Feb 25 00:27:57 2016 +0100
@@ -14,11 +14,9 @@
 {
   def out: String = cat_lines(out_lines)
   def err: String = cat_lines(err_lines)
+  def error(s: String): Process_Result = copy(err_lines = err_lines ::: List(s))
 
-  def error(s: String, err_rc: Int = 0): Process_Result =
-    copy(err_lines = err_lines ::: List(s), rc = rc max err_rc)
-
-  def set_timeout(t: Time): Process_Result = copy(timeout = Some(t))
+  def set_timeout(t: Time): Process_Result = copy(rc = 1, timeout = Some(t))
 
   def ok: Boolean = rc == 0
   def interrupted: Boolean = rc == Exn.Interrupt.return_code
--- a/src/Pure/Tools/build.scala	Thu Feb 25 00:18:48 2016 +0100
+++ b/src/Pure/Tools/build.scala	Thu Feb 25 00:27:57 2016 +0100
@@ -642,7 +642,7 @@
 
       if (res.interrupted) {
         was_timeout match {
-          case Some(t) => res.error(Output.error_text("Timeout"), 1).set_timeout(t)
+          case Some(t) => res.error(Output.error_text("Timeout")).set_timeout(t)
           case None => res.error(Output.error_text("Interrupt"))
         }
       }