summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/lib/tk.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 0943e5406e..a5d2645e98 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -1614,7 +1614,16 @@ module Tk
def Tk.errorCode
INTERP._invoke_without_enc('global', 'errorCode')
- tk_split_simplelist(INTERP._invoke_without_enc('set', 'errorCode'))
+ code = tk_split_simplelist(INTERP._invoke_without_enc('set', 'errorCode'))
+ case code[0]
+ when 'CHILDKILLED', 'CHILDSTATUS', 'CHILDSUSP'
+ begin
+ pid = Integer(code[1])
+ code[1] = pid
+ rescue
+ end
+ end
+ code
end
def root