1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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:
matz 2003-12-04 21:57:35 +00:00
parent 01d06638b9
commit 7e6cecb769
4 changed files with 27 additions and 14 deletions

View file

@ -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):
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>
* lib/drb/drb.rb (DRb::DRbMessage::send_request, send_reply):

4
dln.c
View file

@ -1221,7 +1221,7 @@ aix_loaderror(const char *pathname)
int i,j;
struct errtab {
int errno;
int errnum;
char *errstr;
} load_errtab[] = {
{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++) {
int nerr = atoi(message[i]);
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);
}
while (isdigit(*message[i])) message[i]++;

8
eval.c
View file

@ -2856,6 +2856,7 @@ rb_eval(self, n)
PUSH_TAG(PROT_NONE);
if ((state = EXEC_TAG()) == 0) {
retry_entry:
result = rb_eval(self, node->nd_head);
}
else if (rescuing) {
@ -2864,11 +2865,10 @@ rb_eval(self, n)
}
else if (state == TAG_RETRY) {
rescuing = state = 0;
e_info = ruby_errinfo = Qnil;
result = rb_eval(self, node->nd_head);
ruby_errinfo = e_info;
goto retry_entry;
}
else if (state != TAG_RAISE) {
ruby_errinfo = e_info;
result = prot_tag->retval;
}
}
@ -2882,7 +2882,6 @@ rb_eval(self, n)
state = 0;
rescuing = 1;
result = rb_eval(self, resq->nd_body);
ruby_errinfo = e_info;
break;
}
resq = resq->nd_head; /* next rescue */
@ -2892,6 +2891,7 @@ rb_eval(self, n)
result = prot_tag->retval;
}
POP_TAG();
if (state != TAG_RAISE) ruby_errinfo = e_info;
if (state) {
if (state == TAG_NEXT) prot_tag->retval = result;
JUMP_TAG(state);

14
io.c
View file

@ -762,7 +762,7 @@ remain_size(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;
if (siz > LONG_MAX) {
rb_raise(rb_eIOError, "file too big for single read");
@ -780,25 +780,23 @@ read_all(fptr, siz, str)
{
long bytes = 0;
long n;
off_t pos = 0;
if (feof(fptr->f)) return Qnil;
READ_CHECK(fptr->f);
if (!siz) siz = BUFSIZ;
if (siz == 0) siz = BUFSIZ;
if (NIL_P(str)) {
str = rb_tainted_str_new(0, siz);
}
else {
rb_str_resize(str, siz);
}
pos = io_tell(fptr);
for (;;) {
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);
if (!fptr->f) return Qnil;
if (feof(fptr->f)) return Qnil;
if (!ferror(fptr->f)) return str;
if (!fptr->f) break;
if (feof(fptr->f)) break;
if (!ferror(fptr->f)) break;
rb_sys_fail(fptr->path);
}
bytes += n;