diff --git a/ChangeLog b/ChangeLog index dce5d64b96..51e03f3a1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +Wed Oct 18 03:10:20 2000 Yukihiro Matsumoto + + * stable version 1.6.2 released. + +Tue Oct 17 17:30:34 2000 WATANABE Hirofumi + + * eval.c (error_print): ruby_sourcefile may be NULL. + +Tue Oct 17 16:36:28 2000 Wes Nakamura + + * pack.c (NATINT_U32): wrong use of sizeof. + +Tue Oct 17 12:48:20 2000 Katsuyuki Komatsu + + * eval.c (rb_abort): nil check against ruby_errinfo. + + * eval.c (rb_thread_schedule): use FOREACH_THREAD_FROM instead of + FOREACH_THREAD, since curr_thread may be removed from thread ring. + + * eval.c (THREAD_ALLOC): errinfo should be Qnil. + + * eval.c (rb_callcc): th->prev,th->next are now already + initialized in THREAD_ALLOC. + Mon Oct 16 15:37:33 2000 Kazuhiro NISHIYAMA * eval.c (rb_thread_inspect): tag size was shorter than required. @@ -27,6 +51,18 @@ Mon Oct 16 01:02:02 2000 Yukihiro Matsumoto * parse.y (sym): symbols for class variable names. +Sun Oct 15 01:49:18 2000 Yukihiro Matsumoto + + * file.c (rb_file_flock): should accept interrupt. + + * process.c (rb_waitpid): ditto. + + * process.c (rb_waitpid): ditto. + + * process.c (proc_wait): ditto. + + * process.c (proc_waitpid2): wrong recursion. + Sat Oct 14 03:32:13 2000 Yukihiro Matsumoto * eval.c (rb_thread_alloc): should not link a new thread in the diff --git a/eval.c b/eval.c index e187d38a41..02da6af508 100644 --- a/eval.c +++ b/eval.c @@ -882,7 +882,10 @@ error_print() } POP_TAG(); if (NIL_P(errat)) { - fprintf(stderr, "%s:%d", ruby_sourcefile, ruby_sourceline); + if (ruby_sourcefile) + fprintf(stderr, "%s:%d", ruby_sourcefile, ruby_sourceline); + else + fprintf(stderr, "%d", ruby_sourceline); } else { VALUE mesg = RARRAY(errat)->ptr[0]; @@ -3224,7 +3227,7 @@ rb_f_exit(argc, argv, obj) static void rb_abort() { - if (ruby_errinfo) { + if (!NIL_P(ruby_errinfo)) { error_print(); } rb_exit(1); @@ -7110,7 +7113,7 @@ rb_thread_schedule() if (n < 0) { if (rb_trap_pending) rb_trap_exec(); if (errno == EINTR) goto again; - FOREACH_THREAD(th) { + FOREACH_THREAD_FROM(curr, th) { if (th->wait_for & WAIT_SELECT) { int v = 0; @@ -7123,7 +7126,7 @@ rb_thread_schedule() } } } - END_FOREACH(th); + END_FOREACH_FROM(curr, th); } if (n > 0) { now = -1.0; @@ -7638,7 +7641,6 @@ rb_thread_abort_exc_set(thread, val) \ th->status = THREAD_RUNNABLE;\ th->result = 0;\ - th->errinfo = Qnil;\ \ th->stk_ptr = 0;\ th->stk_len = 0;\ @@ -7659,7 +7661,7 @@ rb_thread_abort_exc_set(thread, val) th->iter = 0;\ th->tag = 0;\ th->tracing = 0;\ - th->errinfo = 0;\ + th->errinfo = Qnil;\ th->last_status = 0;\ th->last_line = 0;\ th->last_match = 0;\ @@ -8205,7 +8207,6 @@ rb_callcc(self) for (tag=prot_tag; tag; tag=tag->prev) { scope_dup(tag->scope); } - th->prev = th->next = 0; th->thread = curr_thread->thread; for (vars = th->dyna_vars; vars; vars = vars->next) { diff --git a/file.c b/file.c index 3e0ff4c8fa..737ed5d88e 100644 --- a/file.c +++ b/file.c @@ -1530,6 +1530,7 @@ rb_file_flock(obj, operation) { #ifndef __CHECKER__ OpenFile *fptr; + int ret; rb_secure(2); GetOpenFile(obj, fptr); @@ -1537,7 +1538,10 @@ rb_file_flock(obj, operation) if (fptr->mode & FMODE_WRITABLE) { fflush(GetWriteFile(fptr)); } - if (flock(fileno(fptr->f), NUM2INT(operation)) < 0) { + TRAP_BEG; + ret = flock(fileno(fptr->f), NUM2INT(operation)); + TRAP_END; + if (ret < 0) { #ifdef EWOULDBLOCK if (errno == EWOULDBLOCK) { return Qfalse; diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb index 6940546ab2..48f3496939 100644 --- a/lib/cgi/session.rb +++ b/lib/cgi/session.rb @@ -52,7 +52,8 @@ class CGI request.instance_eval do @output_hidden = {session_key => id} @output_cookies = [ - Cookie::new(session_key => id, + Cookie::new("name" => session_key, + "value" => id, "path" => if ENV["SCRIPT_NAME"] then File::dirname(ENV["SCRIPT_NAME"]) else @@ -84,6 +85,10 @@ class CGI @dbman.update end + def close + @dbman.close + end + def delete @dbman.delete end diff --git a/pack.c b/pack.c index ee63ffd35c..173c7d80ad 100644 --- a/pack.c +++ b/pack.c @@ -24,8 +24,8 @@ #ifdef NATINT_PACK # define OFF16B(p) ((char*)(p) + (natint?0:(sizeof(short) - SIZE16))) # define OFF32B(p) ((char*)(p) + (natint?0:(sizeof(long) - SIZE32))) -# define NATINT_I32(x) (natint?sizeof(NUM2LONG(x)):(NUM2I32(x))) -# define NATINT_U32(x) (natint?sizeof(NUM2ULONG(x)):(NUM2U32(x))) +# define NATINT_I32(x) (natint?NUM2LONG(x):(NUM2I32(x))) +# define NATINT_U32(x) (natint?NUM2ULONG(x):(NUM2U32(x))) # define NATINT_LEN(type,len) (natint?sizeof(type):(len)) # ifdef WORDS_BIGENDIAN # define OFF16(p) OFF16B(p) @@ -38,12 +38,15 @@ #endif #ifndef OFF16 -# define OFF16B(p) (char*)(p) -# define OFF32B(p) (char*)(p) # define OFF16(p) (char*)(p) # define OFF32(p) (char*)(p) #endif +#ifndef OFF16B +# define OFF16B(p) (char*)(p) +# define OFF32B(p) (char*)(p) +#endif + #define define_swapx(x, xtype) \ static xtype \ TOKEN_PASTE(swap,x)(z) \ diff --git a/process.c b/process.c index a99e902b59..0675f8e2db 100644 --- a/process.c +++ b/process.c @@ -86,11 +86,13 @@ rb_waitpid(pid, flags, st) } retry: + TRAP_BEG; #ifdef HAVE_WAITPID result = waitpid(pid, st, flags); #else /* HAVE_WAIT4 */ result = wait4(pid, st, flags, NULL); #endif + TRAP_END; if (result < 0) { if (errno == EINTR) { rb_thread_polling(); @@ -116,7 +118,9 @@ rb_waitpid(pid, flags, st) } for (;;) { + TRAP_BEG; result = wait(st); + TRAP_END; if (result < 0) { if (errno == EINTR) { rb_thread_schedule(); @@ -170,7 +174,11 @@ proc_wait() return INT2FIX(data.pid); } - while ((pid = wait(&state)) < 0) { + while (1) { + TRAP_BEG; + pid = wait(&state); + TRA_END; + if (pid >= 0) break; if (errno == EINTR) { rb_thread_schedule(); continue; @@ -218,7 +226,7 @@ proc_waitpid2(argc, argv) int argc; VALUE *argv; { - VALUE pid = proc_waitpid2(argc, argv); + VALUE pid = proc_waitpid(argc, argv); return rb_assoc_new(pid, rb_last_status); } diff --git a/time.c b/time.c index cadd72cf19..f8426adf4f 100644 --- a/time.c +++ b/time.c @@ -1098,6 +1098,7 @@ Init_Time() rb_define_method(rb_cTime, "wday", time_wday, 0); rb_define_method(rb_cTime, "yday", time_yday, 0); rb_define_method(rb_cTime, "isdst", time_isdst, 0); + rb_define_method(rb_cTime, "dst?", time_isdst, 0); rb_define_method(rb_cTime, "zone", time_zone, 0); rb_define_method(rb_cTime, "utc?", time_utc_p, 0); diff --git a/version.h b/version.h index ec5e20e2e2..6fffa240ba 100644 --- a/version.h +++ b/version.h @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.6.2" -#define RUBY_RELEASE_DATE "2000-10-16" +#define RUBY_RELEASE_DATE "2000-10-18" #define RUBY_VERSION_CODE 162 -#define RUBY_RELEASE_CODE 20001016 +#define RUBY_RELEASE_CODE 20001018