Changeset 3185 for trunk/lang/tcl/scripts/exec.tcl
- Timestamp:
- Oct 18, 2012, 3:01:53 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lang/tcl/scripts/exec.tcl
r3182 r3185 46 46 append execout(output) $execout(extra) 47 47 48 if {$status != 0} { 49 if {[regexp {^KILLED} $execctl] && [llength $execctl] == 4} { 50 set reason [lindex $execctl end] 51 set result "job killed: $reason" 52 } 48 if { $status != 0 } { 49 # We're here because the exec-ed program failed 50 if { $execctl != "" } { 51 foreach { token pid code mesg } $execctl break 52 if { $token == "EXITED" } { 53 # This means that the program exited normally but 54 # returned a non-zero exitcode. Consider this an 55 # invalid result from the program. Append the stderr 56 # from the program to the message. 57 set result \ 58 "Program finished: exit code is $code\n\n" 59 append result $execout(error) 60 } elseif { $token == "abort" } { 61 # The user pressed the abort button. 62 set result "Program terminated by user.\n\n" 63 append result $execout(output) 64 } else { 65 # Abnormal termination 66 set result "Abnormal program termination: $mesg\n\n" 67 append result $execout(output) 68 } 69 } 53 70 error $result 54 71 } … … 72 89 # 73 90 if {$channel == "stderr"} { 91 append execout(error) $message 74 92 set newmesg "" 75 93 foreach line [split $message \n] { … … 78 96 set message $newmesg 79 97 } 80 81 98 # 82 99 # If this message is coming in on the same channel as the
Note: See TracChangeset
for help on using the changeset viewer.