summaryrefslogtreecommitdiffstats
path: root/ext/tk/lib
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-07 08:38:03 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-07 08:38:03 +0000
commit94754d04577280a487146094a9a82339a5087a15 (patch)
tree350448d8338e2bfb7a9fa1176849eb40d464e07d /ext/tk/lib
parent4947e62309dd844cf55af32bd94690ba87121488 (diff)
downloadruby-94754d04577280a487146094a9a82339a5087a15.tar.gz
ruby-94754d04577280a487146094a9a82339a5087a15.tar.xz
ruby-94754d04577280a487146094a9a82339a5087a15.zip
* ext/tk/lib/tk.rb: When CHILDKILLED and so on, Tk.errorCode returns
a Fixnum for 2nd element (it's pid) of the return value. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib')
-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 0943e5406..a5d2645e9 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