#BUGFIX by Maren
authormatilk
Wed, 31 Oct 2018 12:33:32 +0100
changeset 23493 1a37df0ecc81
parent 23492 04f053648df7
child 23494 72dea3b3fc38
#BUGFIX by Maren class: OSProcess changed: #execute oops - killed all subprocesses when finished. This is not ok, if the executed command did actually start a background process (eg. adb server does this)
OSProcess.st
--- a/OSProcess.st	Tue Oct 30 11:57:25 2018 +0100
+++ b/OSProcess.st	Wed Oct 31 12:33:32 2018 +0100
@@ -772,10 +772,16 @@
     |ok procs streams|
 
     [
-        ok := self startProcess.
-        ok ifTrue:[
-            self waitUntilFinished.
-            ok := self finishedWithSuccess.
+        [
+            ok := self startProcess.
+            ok ifTrue:[
+                self waitUntilFinished.
+                ok := self finishedWithSuccess.
+            ].
+        ] ifCurtailed:[
+            pid notNil ifTrue:[
+                self terminateGroup.
+            ].
         ].
     ] ensure:[
         "/ we were interrupted -
@@ -790,14 +796,11 @@
             shufflerProcesses := nil.
             procs do:[:eachProc | eachProc terminate].
         ].
-        pid notNil ifTrue:[
-            self terminateGroup.
-        ].
     ].
     ^ ok.
 
-    "Modified (comment): / 23-02-2017 / 10:54:34 / Maren"
     "Modified: / 29-10-2018 / 15:59:33 / Claus Gittinger"
+    "Modified: / 31-10-2018 / 12:31:42 / Maren"
 !
 
 startProcess