* eval.c (rb_thread_atfork): wrong format specifier.

[ruby-dev:21428]

* process.c (pst_inspect): better description.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-09-29 02:44:49 +00:00
parent b2cf59aa1c
commit 4699b4afbb
8 changed files with 69 additions and 5 deletions

View File

@ -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.

2
eval.c
View File

@ -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);
}
}

View File

@ -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);

View File

@ -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);

View File

@ -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 */

View File

@ -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)

View File

@ -144,6 +144,48 @@ pst_pid(st)
return rb_iv_get(st, "pid");
}
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);

View File

@ -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;