src/Pure/General/ssh.scala
changeset 64136 7c5191489457
parent 64135 865dda40e1cc
child 64137 e9b3d9c1bc5a
equal deleted inserted replaced
64135:865dda40e1cc 64136:7c5191489457
   152       val out_lines = Future.thread("ssh_stdout") { read_lines(stdout, progress_stdout) }
   152       val out_lines = Future.thread("ssh_stdout") { read_lines(stdout, progress_stdout) }
   153       val err_lines = Future.thread("ssh_stderr") { read_lines(stderr, progress_stderr) }
   153       val err_lines = Future.thread("ssh_stderr") { read_lines(stderr, progress_stderr) }
   154 
   154 
   155       def terminate()
   155       def terminate()
   156       {
   156       {
   157         channel.disconnect
   157         close
   158         out_lines.join
   158         out_lines.join
   159         err_lines.join
   159         err_lines.join
   160         exit_status.join
   160         exit_status.join
   161       }
   161       }
   162 
   162 
   163       val rc =
   163       val rc =
   164         try { exit_status.join }
   164         try { exit_status.join }
   165         catch { case Exn.Interrupt() => terminate(); Exn.Interrupt.return_code }
   165         catch { case Exn.Interrupt() => terminate(); Exn.Interrupt.return_code }
   166 
   166 
       
   167       close
   167       if (strict && rc == Exn.Interrupt.return_code) throw Exn.Interrupt()
   168       if (strict && rc == Exn.Interrupt.return_code) throw Exn.Interrupt()
   168 
   169 
   169       Process_Result(rc, out_lines.join, err_lines.join)
   170       Process_Result(rc, out_lines.join, err_lines.join)
   170     }
   171     }
   171   }
   172   }