* io.c (rb_io_popen): do not call rb_io_close() directly, call
"close" method instead. [ruby-dev:19717] * io.c (rb_io_s_open): ditto. * hash.c (rb_any_hash): remove DEFER_INTS. all do_hash() calls in st.c are at the top of functions. No reentrant problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a38c2ac2dd
commit
d37e836a58
14
ChangeLog
14
ChangeLog
@ -4,6 +4,16 @@ Tue Mar 4 15:08:08 2003 WATANABE Hirofumi <eban@ruby-lang.org>
|
|||||||
|
|
||||||
* missing/strftime.c: ditto.
|
* missing/strftime.c: ditto.
|
||||||
|
|
||||||
|
Tue Mar 4 10:11:32 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (rb_io_popen): do not call rb_io_close() directly, call
|
||||||
|
"close" method instead. [ruby-dev:19717]
|
||||||
|
|
||||||
|
* io.c (rb_io_s_open): ditto.
|
||||||
|
|
||||||
|
* hash.c (rb_any_hash): remove DEFER_INTS. all do_hash() calls in
|
||||||
|
st.c are at the top of functions. No reentrant problem.
|
||||||
|
|
||||||
Tue Mar 4 01:19:21 2003 Akinori MUSHA <knu@iDaemons.org>
|
Tue Mar 4 01:19:21 2003 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* ext/dl/MANIFEST: Exclude .cvsignore. [found by: eban]
|
* ext/dl/MANIFEST: Exclude .cvsignore. [found by: eban]
|
||||||
@ -569,6 +579,10 @@ Thu Jan 30 08:27:19 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
|||||||
|
|
||||||
* file.c (rb_file_s_expand_path): removed a sludge.
|
* file.c (rb_file_s_expand_path): removed a sludge.
|
||||||
|
|
||||||
|
Wed Jan 29 03:24:39 2003 Michal Rokos <michal@rokos.homeip.net>
|
||||||
|
|
||||||
|
* dir.c (glob_helper): memory leak fixed.
|
||||||
|
|
||||||
Tue Jan 28 04:45:03 2003 Akinori MUSHA <knu@iDaemons.org>
|
Tue Jan 28 04:45:03 2003 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* instruby.rb (parse_args), ext/extmk.rb (parse_args): Prepend a
|
* instruby.rb (parse_args), ext/extmk.rb (parse_args): Prepend a
|
||||||
|
1
dir.c
1
dir.c
@ -778,6 +778,7 @@ glob_helper(path, sub, flags, func, arg)
|
|||||||
sprintf(buf, "%s%s%s", base, (BASE) ? "/" : "", dp->d_name);
|
sprintf(buf, "%s%s%s", base, (BASE) ? "/" : "", dp->d_name);
|
||||||
if (lstat(buf, &st) < 0) {
|
if (lstat(buf, &st) < 0) {
|
||||||
if (errno != ENOENT) rb_sys_warning(buf);
|
if (errno != ENOENT) rb_sys_warning(buf);
|
||||||
|
free(buf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (S_ISDIR(st.st_mode)) {
|
if (S_ISDIR(st.st_mode)) {
|
||||||
|
6
hash.c
6
hash.c
@ -65,6 +65,8 @@ rb_any_cmp(a, b)
|
|||||||
VALUE a, b;
|
VALUE a, b;
|
||||||
{
|
{
|
||||||
VALUE args[2];
|
VALUE args[2];
|
||||||
|
|
||||||
|
if (a == b) return 0;
|
||||||
if (FIXNUM_P(a) && FIXNUM_P(b)) {
|
if (FIXNUM_P(a) && FIXNUM_P(b)) {
|
||||||
return a != b;
|
return a != b;
|
||||||
}
|
}
|
||||||
@ -72,10 +74,10 @@ rb_any_cmp(a, b)
|
|||||||
TYPE(b) == T_STRING && RBASIC(b)->klass == rb_cString) {
|
TYPE(b) == T_STRING && RBASIC(b)->klass == rb_cString) {
|
||||||
return rb_str_cmp(a, b);
|
return rb_str_cmp(a, b);
|
||||||
}
|
}
|
||||||
|
if (a == Qundef || b == Qundef) return -1;
|
||||||
if (SYMBOL_P(a) && SYMBOL_P(b)) {
|
if (SYMBOL_P(a) && SYMBOL_P(b)) {
|
||||||
return a != b;
|
return a != b;
|
||||||
}
|
}
|
||||||
if (a == Qundef || b == Qundef) return -1;
|
|
||||||
|
|
||||||
args[0] = a;
|
args[0] = a;
|
||||||
args[1] = b;
|
args[1] = b;
|
||||||
@ -99,12 +101,10 @@ rb_any_hash(a)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DEFER_INTS;
|
|
||||||
hval = rb_funcall(a, id_hash, 0);
|
hval = rb_funcall(a, id_hash, 0);
|
||||||
if (!FIXNUM_P(hval)) {
|
if (!FIXNUM_P(hval)) {
|
||||||
hval = rb_funcall(hval, '%', 1, INT2FIX(536870923));
|
hval = rb_funcall(hval, '%', 1, INT2FIX(536870923));
|
||||||
}
|
}
|
||||||
ENABLE_INTS;
|
|
||||||
return (int)FIX2LONG(hval);
|
return (int)FIX2LONG(hval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
32
io.c
32
io.c
@ -1421,6 +1421,12 @@ rb_io_close_m(io)
|
|||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
io_close(io)
|
||||||
|
{
|
||||||
|
return rb_funcall(io, rb_intern("close"), 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_io_closed(io)
|
rb_io_closed(io)
|
||||||
VALUE io;
|
VALUE io;
|
||||||
@ -2154,7 +2160,7 @@ rb_io_popen(str, argc, argv, klass)
|
|||||||
}
|
}
|
||||||
RBASIC(port)->klass = klass;
|
RBASIC(port)->klass = klass;
|
||||||
if (rb_block_given_p()) {
|
if (rb_block_given_p()) {
|
||||||
return rb_ensure(rb_yield, port, rb_io_close, port);
|
return rb_ensure(rb_yield, port, io_close, port);
|
||||||
}
|
}
|
||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
@ -2209,7 +2215,7 @@ rb_io_s_open(argc, argv, klass)
|
|||||||
VALUE io = rb_class_new_instance(argc, argv, klass);
|
VALUE io = rb_class_new_instance(argc, argv, klass);
|
||||||
|
|
||||||
if (rb_block_given_p()) {
|
if (rb_block_given_p()) {
|
||||||
return rb_ensure(rb_yield, io, rb_io_close, io);
|
return rb_ensure(rb_yield, io, io_close, io);
|
||||||
}
|
}
|
||||||
|
|
||||||
return io;
|
return io;
|
||||||
@ -2999,16 +3005,6 @@ next_argv()
|
|||||||
return Qtrue;
|
return Qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
any_close(file)
|
|
||||||
VALUE file;
|
|
||||||
{
|
|
||||||
if (TYPE(file) == T_FILE)
|
|
||||||
rb_io_close(file);
|
|
||||||
else
|
|
||||||
rb_funcall3(file, rb_intern("close"), 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
argf_getline(argc, argv)
|
argf_getline(argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
@ -3039,7 +3035,7 @@ argf_getline(argc, argv)
|
|||||||
line = rb_io_getline(rs, fptr);
|
line = rb_io_getline(rs, fptr);
|
||||||
}
|
}
|
||||||
if (NIL_P(line) && next_p != -1) {
|
if (NIL_P(line) && next_p != -1) {
|
||||||
any_close(current_file);
|
io_close(current_file);
|
||||||
next_p = 1;
|
next_p = 1;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
@ -3074,7 +3070,7 @@ rb_gets()
|
|||||||
if (!next_argv()) return Qnil;
|
if (!next_argv()) return Qnil;
|
||||||
line = rb_io_gets(current_file);
|
line = rb_io_gets(current_file);
|
||||||
if (NIL_P(line) && next_p != -1) {
|
if (NIL_P(line) && next_p != -1) {
|
||||||
any_close(current_file);
|
io_close(current_file);
|
||||||
next_p = 1;
|
next_p = 1;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
@ -3725,7 +3721,7 @@ argf_read(argc, argv)
|
|||||||
tmp = io_read(argc, argv, current_file);
|
tmp = io_read(argc, argv, current_file);
|
||||||
}
|
}
|
||||||
if (NIL_P(tmp) && next_p != -1) {
|
if (NIL_P(tmp) && next_p != -1) {
|
||||||
any_close(current_file);
|
io_close(current_file);
|
||||||
next_p = 1;
|
next_p = 1;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
@ -3758,7 +3754,7 @@ argf_getc()
|
|||||||
byte = rb_io_getc(current_file);
|
byte = rb_io_getc(current_file);
|
||||||
}
|
}
|
||||||
if (NIL_P(byte) && next_p != -1) {
|
if (NIL_P(byte) && next_p != -1) {
|
||||||
any_close(current_file);
|
io_close(current_file);
|
||||||
next_p = 1;
|
next_p = 1;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
@ -3850,7 +3846,7 @@ static VALUE
|
|||||||
argf_skip()
|
argf_skip()
|
||||||
{
|
{
|
||||||
if (next_p != -1) {
|
if (next_p != -1) {
|
||||||
any_close(current_file);
|
io_close(current_file);
|
||||||
next_p = 1;
|
next_p = 1;
|
||||||
}
|
}
|
||||||
return argf;
|
return argf;
|
||||||
@ -3859,7 +3855,7 @@ argf_skip()
|
|||||||
static VALUE
|
static VALUE
|
||||||
argf_close()
|
argf_close()
|
||||||
{
|
{
|
||||||
any_close(current_file);
|
io_close(current_file);
|
||||||
if (next_p != -1) {
|
if (next_p != -1) {
|
||||||
next_p = 1;
|
next_p = 1;
|
||||||
}
|
}
|
||||||
|
@ -497,7 +497,7 @@ status:
|
|||||||
$stderr.printf("name:%s value:%s\n", name, value) if $DEBUG
|
$stderr.printf("name:%s value:%s\n", name, value) if $DEBUG
|
||||||
case name
|
case name
|
||||||
when 'Set-Cookie'
|
when 'Set-Cookie'
|
||||||
table.add($1, $2)
|
table.add(name, value)
|
||||||
when /^status$/ni
|
when /^status$/ni
|
||||||
Apache::request.status_line = value
|
Apache::request.status_line = value
|
||||||
Apache::request.status = value.to_i
|
Apache::request.status = value.to_i
|
||||||
|
Loading…
x
Reference in New Issue
Block a user