diff options
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | ext/digest/digest.c | 2 | ||||
-rw-r--r-- | ext/stringio/stringio.c | 2 | ||||
-rw-r--r-- | intern.h | 1 | ||||
-rw-r--r-- | lib/mkmf.rb | 2 | ||||
-rw-r--r-- | process.c | 44 | ||||
-rw-r--r-- | signal.c | 7 |
8 files changed, 69 insertions, 5 deletions
@@ -1,3 +1,10 @@ +Mon Sep 29 11:16:55 2003 Yukihiro Matsumoto <matz@ruby-lang.org> + + * eval.c (rb_thread_atfork): wrong format specifier. + [ruby-dev:21428] + + * process.c (pst_inspect): better description. + Mon Sep 29 02:31:44 2003 GOTOU Yuuzou <gotoyuzo@notwork.org> * lib/webrick/utils.rb (Utils::su): use setgid and setuid to @@ -11,6 +18,13 @@ Mon Sep 27 18:25:13 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org> * test/xsd/test_xsd.rb: add tests for above fix. +Sun Sep 28 11:14:19 2003 Koji Arai <jca02266@nifty.ne.jp> + + * ext/digest/digest.c (Init_digest): `copy_object' was deprecated. + `initialize_copy' should be defined. + + * ext/stringio/stringio.c (Init_stringio): ditto. + Mon Sep 27 15:58:50 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org> * lib/soap/rpc/cgistub.rb: make logging severity threshold higher. @@ -9902,7 +9902,7 @@ rb_thread_atfork() if (rb_thread_alone()) return; FOREACH_THREAD(th) { if (th != curr_thread) { - rb_warn("fork terminates thread at %s:%s", th->node->nd_file, nd_line(th->node)); + rb_warn("fork terminates thread at %s:%d", th->node->nd_file, nd_line(th->node)); rb_thread_die(th); } } diff --git a/ext/digest/digest.c b/ext/digest/digest.c index a170678cf..9bc9905d1 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -303,7 +303,7 @@ Init_digest() rb_define_singleton_method(cDigest_Base, "hexdigest", rb_digest_base_s_hexdigest, 1); rb_define_method(cDigest_Base, "initialize", rb_digest_base_init, -1); - rb_define_method(cDigest_Base, "copy_object", rb_digest_base_copy, 1); + rb_define_method(cDigest_Base, "initialize_copy", rb_digest_base_copy, 1); rb_define_method(cDigest_Base, "update", rb_digest_base_update, 1); rb_define_method(cDigest_Base, "<<", rb_digest_base_update, 1); rb_define_method(cDigest_Base, "digest", rb_digest_base_digest, 0); diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 7dfd8e6bd..5f824e3f5 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -903,7 +903,7 @@ Init_stringio() rb_define_alloc_func(StringIO, strio_s_allocate); rb_define_singleton_method(StringIO, "open", strio_s_open, -1); rb_define_method(StringIO, "initialize", strio_initialize, -1); - rb_define_method(StringIO, "copy_object", strio_copy, 1); + rb_define_method(StringIO, "initialize_copy", strio_copy, 1); rb_define_method(StringIO, "reopen", strio_reopen, -1); rb_define_method(StringIO, "string", strio_get_string, 0); @@ -374,6 +374,7 @@ void posix_signal _((int, RETSIGTYPE (*)(int))); #endif void rb_trap_exit _((void)); void rb_trap_exec _((void)); +char *ruby_signal_name _((int)); /* sprintf.c */ VALUE rb_f_sprintf _((int, VALUE*)); /* string.c */ diff --git a/lib/mkmf.rb b/lib/mkmf.rb index cadf81ee2..0ff6351d0 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -228,7 +228,7 @@ end def cpp_command(outfile, opt="") "$(CPP) #$INCFLAGS -I#{$hdrdir} " \ - "#$CPPFLAGS #$CFLAGS #{outfile} #{opt} #{CONFTEST_C}" + "#$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}" end def libpathflag(libpath=$LIBPATH) @@ -145,6 +145,48 @@ pst_pid(st) } static VALUE +pst_inspect(st) + VALUE st; +{ + VALUE pid; + int status; + VALUE str; + char buf[256]; + + pid = pst_pid(st); + status = NUM2INT(st); + + snprintf(buf, sizeof(buf), "#<%s: pid=%ld", rb_class2name(CLASS_OF(st)), NUM2LONG(pid)); + str = rb_str_new2(buf); + if (WIFSTOPPED(status)) { + snprintf(buf, sizeof(buf), ",stopped(%d)", WSTOPSIG(status)); + rb_str_cat2(str, buf); + } + if (WIFSIGNALED(status)) { + int termsig = WTERMSIG(status); + char *signame = ruby_signal_name(termsig); + if (signame) { + snprintf(buf, sizeof(buf), ",signaled(SIG%s=%d)", signame, termsig); + } + else { + snprintf(buf, sizeof(buf), ",signaled(%d)", termsig); + } + rb_str_cat2(str, buf); + } + if (WIFEXITED(status)) { + snprintf(buf, sizeof(buf), ",exited(%d)", WEXITSTATUS(status)); + rb_str_cat2(str, buf); + } +#ifdef WCOREDUMP + if (WCOREDUMP(status)) { + rb_str_cat2(str, ",coredumped"); + } +#endif + rb_str_cat2(str, ">"); + return str; +} + +static VALUE pst_equal(st1, st2) VALUE st1, st2; { @@ -2347,7 +2389,7 @@ Init_process() rb_define_method(rb_cProcStatus, "to_i", pst_to_i, 0); rb_define_method(rb_cProcStatus, "to_int", pst_to_i, 0); rb_define_method(rb_cProcStatus, "to_s", pst_to_s, 0); - rb_define_method(rb_cProcStatus, "inspect", pst_to_s, 0); + rb_define_method(rb_cProcStatus, "inspect", pst_inspect, 0); rb_define_method(rb_cProcStatus, "pid", pst_pid, 0); @@ -191,6 +191,13 @@ signo2signm(no) return 0; } +char * +ruby_signal_name(no) + int no; +{ + return signo2signm(no); +} + VALUE rb_f_kill(argc, argv) int argc; |