diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-07 08:38:03 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-07 08:38:03 +0000 |
commit | e95d791e6236dcdd328bd547a937ac6a0f0bef00 (patch) | |
tree | 8205a8a4d970d35cf7d7d6eae84aef491efc0eb5 /ext | |
parent | 68a9d6820d547e89babba6b8d5bae10b5096c19a (diff) |
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/tk/lib/tk.rb | 11 |
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 |