OSProcess.st
changeset 25070 26915eb67235
parent 24822 24ceeb53827e
child 25072 cd9ca7569011
equal deleted inserted replaced
25069:f82e303cd35d 25070:26915eb67235
  1062         Transcript showCR:(('OS command: ', self startCommand printString) withColor:Color brown).  
  1062         Transcript showCR:(('OS command: ', self startCommand printString) withColor:Color brown).  
  1063     ].
  1063     ].
  1064 
  1064 
  1065     callingProcess := Processor activeProcess.
  1065     callingProcess := Processor activeProcess.
  1066     
  1066     
  1067     Processor 
  1067     pid := Processor 
  1068         monitor:[
  1068         monitor:[
  1069             pid := OperatingSystem
  1069             OperatingSystem
  1070                         startProcess:(self startCommand)
  1070                         startProcess:(self startCommand)
  1071                         inputFrom:externalInStream
  1071                         inputFrom:externalInStream
  1072                         outputTo:externalOutStream
  1072                         outputTo:externalOutStream
  1073                         errorTo:externalErrorStream
  1073                         errorTo:externalErrorStream
  1074                         auxFrom:externalAuxInStream
  1074                         auxFrom:externalAuxInStream
  1120     "/ nil those references here, because there is still a home-context reference from the
  1120     "/ nil those references here, because there is still a home-context reference from the
  1121     "/ monitor-pid action block. Otheriwse, the garbage collector might not collect them.
  1121     "/ monitor-pid action block. Otheriwse, the garbage collector might not collect them.
  1122     externalInStream := externalAuxInStream := externalAuxOutStream := externalOutStream := externalErrorStream := nil.
  1122     externalInStream := externalAuxInStream := externalAuxOutStream := externalOutStream := externalErrorStream := nil.
  1123     
  1123     
  1124     pid isNil ifTrue:[
  1124     pid isNil ifTrue:[
  1125         UserPreferences current logExecutedOSCommands ifTrue:[
  1125         "process could not be started!!"
  1126             Transcript 
       
  1127                 showCR:(('OS command failed: %1'bindWith: self startCommand) allRed).  
       
  1128         ].
       
  1129 
       
  1130         "process could not be started - terminate shufflers"
       
  1131         self terminateShufflerProcesses.
  1126         self terminateShufflerProcesses.
  1132 
  1127 
  1133         exitStatus := OperatingSystem osProcessStatusClass processCreationFailure.
  1128         exitStatus := OperatingSystem osProcessStatusClass processCreationFailure.
  1134         finishSema signal.
  1129         finishSema signal.
  1135         terminateActionBlock notNil ifTrue:[
  1130         terminateActionBlock notNil ifTrue:[
  1136             terminateActionBlock valueWithOptionalArgument:exitStatus and:self.
  1131             terminateActionBlock valueWithOptionalArgument:exitStatus and:self.
  1137         ].
  1132         ].
       
  1133         UserPreferences current logExecutedOSCommands ifTrue:[
       
  1134             Transcript 
       
  1135                 showCR:(('OS command failed: %1'bindWith: self startCommand) allRed).  
       
  1136         ].
       
  1137 
  1138         ^ false.
  1138         ^ false.
  1139     ].
  1139     ].
  1140 
  1140 
  1141     ^ true.
  1141     ^ true.
  1142 
  1142