aboutsummaryrefslogtreecommitdiffstats
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
commit046d4e7ee113eac1c6a9ab848adb978c07b06aae (patch)
tree350448d8338e2bfb7a9fa1176849eb40d464e07d
parent607314595a4b9a69b21b06ce2593a9031c98c0c8 (diff)
downloadruby-046d4e7ee113eac1c6a9ab848adb978c07b06aae.tar.gz
* 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/trunk@7012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/tk/lib/tk.rb11
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 892ba8f5a5..cf39d9df8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Oct 7 17:36:25 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * 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.
+
Thu Oct 7 12:55:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (io_read): should freeze buffer before thread context
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