From a653fb580318c232b89ddad54a53175f23befd69 Mon Sep 17 00:00:00 2001 From: nagai Date: Thu, 7 Oct 2004 08:38:03 +0000 Subject: * 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/branches/ruby_1_8@7012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/lib/tk.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ext/tk/lib') 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 -- cgit