* dln.c (aix_loaderror): should not use member named 'errno' which
might be a macro (e.g. on AIX). * io.c (read_all): do not depend on lseek position. [ruby-dev:22026] * eval.c (rb_eval): preserve $! value when retry happens in the rescue clause. [ruby-talk:86697] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
01d06638b9
commit
7e6cecb769
15
ChangeLog
15
ChangeLog
@ -6,6 +6,21 @@ Fri Dec 5 02:49:35 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||||||
* lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
|
* lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
|
||||||
check whether arguments are subclass of Exception.
|
check whether arguments are subclass of Exception.
|
||||||
|
|
||||||
|
Thu Dec 4 23:54:00 2003 Rick Ohnemus <rick.ohnemus@systemware.com>
|
||||||
|
|
||||||
|
* dln.c (aix_loaderror): should not use member named 'errno' which
|
||||||
|
might be a macro (e.g. on AIX).
|
||||||
|
|
||||||
|
Thu Dec 4 23:32:26 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (read_all): do not depend on lseek position.
|
||||||
|
[ruby-dev:22026]
|
||||||
|
|
||||||
|
Thu Dec 4 22:37:26 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_eval): preserve $! value when retry happens in the
|
||||||
|
rescue clause. [ruby-talk:86697]
|
||||||
|
|
||||||
Thu Dec 4 21:50:07 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Dec 4 21:50:07 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/drb/drb.rb (DRb::DRbMessage::send_request, send_reply):
|
* lib/drb/drb.rb (DRb::DRbMessage::send_request, send_reply):
|
||||||
|
4
dln.c
4
dln.c
@ -1221,7 +1221,7 @@ aix_loaderror(const char *pathname)
|
|||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
struct errtab {
|
struct errtab {
|
||||||
int errno;
|
int errnum;
|
||||||
char *errstr;
|
char *errstr;
|
||||||
} load_errtab[] = {
|
} load_errtab[] = {
|
||||||
{L_ERROR_TOOMANY, "too many errors, rest skipped."},
|
{L_ERROR_TOOMANY, "too many errors, rest skipped."},
|
||||||
@ -1248,7 +1248,7 @@ aix_loaderror(const char *pathname)
|
|||||||
for(i = 0; message[i] && *message[i]; i++) {
|
for(i = 0; message[i] && *message[i]; i++) {
|
||||||
int nerr = atoi(message[i]);
|
int nerr = atoi(message[i]);
|
||||||
for (j=0; j<LOAD_ERRTAB_LEN; j++) {
|
for (j=0; j<LOAD_ERRTAB_LEN; j++) {
|
||||||
if (nerr == load_errtab[i].errno && load_errtab[i].errstr)
|
if (nerr == load_errtab[i].errnum && load_errtab[i].errstr)
|
||||||
ERRBUF_APPEND(load_errtab[i].errstr);
|
ERRBUF_APPEND(load_errtab[i].errstr);
|
||||||
}
|
}
|
||||||
while (isdigit(*message[i])) message[i]++;
|
while (isdigit(*message[i])) message[i]++;
|
||||||
|
8
eval.c
8
eval.c
@ -2856,6 +2856,7 @@ rb_eval(self, n)
|
|||||||
|
|
||||||
PUSH_TAG(PROT_NONE);
|
PUSH_TAG(PROT_NONE);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
|
retry_entry:
|
||||||
result = rb_eval(self, node->nd_head);
|
result = rb_eval(self, node->nd_head);
|
||||||
}
|
}
|
||||||
else if (rescuing) {
|
else if (rescuing) {
|
||||||
@ -2864,11 +2865,10 @@ rb_eval(self, n)
|
|||||||
}
|
}
|
||||||
else if (state == TAG_RETRY) {
|
else if (state == TAG_RETRY) {
|
||||||
rescuing = state = 0;
|
rescuing = state = 0;
|
||||||
e_info = ruby_errinfo = Qnil;
|
ruby_errinfo = e_info;
|
||||||
result = rb_eval(self, node->nd_head);
|
goto retry_entry;
|
||||||
}
|
}
|
||||||
else if (state != TAG_RAISE) {
|
else if (state != TAG_RAISE) {
|
||||||
ruby_errinfo = e_info;
|
|
||||||
result = prot_tag->retval;
|
result = prot_tag->retval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2882,7 +2882,6 @@ rb_eval(self, n)
|
|||||||
state = 0;
|
state = 0;
|
||||||
rescuing = 1;
|
rescuing = 1;
|
||||||
result = rb_eval(self, resq->nd_body);
|
result = rb_eval(self, resq->nd_body);
|
||||||
ruby_errinfo = e_info;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
resq = resq->nd_head; /* next rescue */
|
resq = resq->nd_head; /* next rescue */
|
||||||
@ -2892,6 +2891,7 @@ rb_eval(self, n)
|
|||||||
result = prot_tag->retval;
|
result = prot_tag->retval;
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
|
if (state != TAG_RAISE) ruby_errinfo = e_info;
|
||||||
if (state) {
|
if (state) {
|
||||||
if (state == TAG_NEXT) prot_tag->retval = result;
|
if (state == TAG_NEXT) prot_tag->retval = result;
|
||||||
JUMP_TAG(state);
|
JUMP_TAG(state);
|
||||||
|
14
io.c
14
io.c
@ -762,7 +762,7 @@ remain_size(fptr)
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
pos = io_tell(fptr);
|
pos = io_tell(fptr);
|
||||||
if (st.st_size > pos && pos >= 0) {
|
if (st.st_size >= pos && pos >= 0) {
|
||||||
siz = st.st_size - pos + 1;
|
siz = st.st_size - pos + 1;
|
||||||
if (siz > LONG_MAX) {
|
if (siz > LONG_MAX) {
|
||||||
rb_raise(rb_eIOError, "file too big for single read");
|
rb_raise(rb_eIOError, "file too big for single read");
|
||||||
@ -780,25 +780,23 @@ read_all(fptr, siz, str)
|
|||||||
{
|
{
|
||||||
long bytes = 0;
|
long bytes = 0;
|
||||||
long n;
|
long n;
|
||||||
off_t pos = 0;
|
|
||||||
|
|
||||||
if (feof(fptr->f)) return Qnil;
|
if (feof(fptr->f)) return Qnil;
|
||||||
READ_CHECK(fptr->f);
|
READ_CHECK(fptr->f);
|
||||||
if (!siz) siz = BUFSIZ;
|
if (siz == 0) siz = BUFSIZ;
|
||||||
if (NIL_P(str)) {
|
if (NIL_P(str)) {
|
||||||
str = rb_tainted_str_new(0, siz);
|
str = rb_tainted_str_new(0, siz);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rb_str_resize(str, siz);
|
rb_str_resize(str, siz);
|
||||||
}
|
}
|
||||||
pos = io_tell(fptr);
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f);
|
n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f);
|
||||||
if (pos > 0 && n == 0 && bytes == 0) {
|
if (n == 0 && bytes == 0) {
|
||||||
rb_str_resize(str,0);
|
rb_str_resize(str,0);
|
||||||
if (!fptr->f) return Qnil;
|
if (!fptr->f) break;
|
||||||
if (feof(fptr->f)) return Qnil;
|
if (feof(fptr->f)) break;
|
||||||
if (!ferror(fptr->f)) return str;
|
if (!ferror(fptr->f)) break;
|
||||||
rb_sys_fail(fptr->path);
|
rb_sys_fail(fptr->path);
|
||||||
}
|
}
|
||||||
bytes += n;
|
bytes += n;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user