summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--eval.c2
-rw-r--r--ext/digest/digest.c2
-rw-r--r--ext/stringio/stringio.c2
-rw-r--r--intern.h1
-rw-r--r--lib/mkmf.rb2
-rw-r--r--process.c44
-rw-r--r--signal.c7
8 files changed, 69 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dd6c7713..1f26d0666 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/eval.c b/eval.c
index 897ae7e60..3ee0b4d5d 100644
--- a/eval.c
+++ b/eval.c
@@ -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);
diff --git a/intern.h b/intern.h
index 3417acb08..93e6bb8d1 100644
--- a/intern.h
+++ b/intern.h
@@ -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)
diff --git a/process.c b/process.c
index 2cfed92a4..d1c972409 100644
--- a/process.c
+++ b/process.c
@@ -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);
diff --git a/signal.c b/signal.c
index d4bdb2320..bcf7b1d96 100644
--- a/signal.c
+++ b/signal.c
@@ -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;