summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog23
-rw-r--r--io.c15
2 files changed, 22 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 47734107a9..26a09a5ebd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan 6 21:55:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (fptr_finalize): should save errno just after failure.
+ [ruby-dev:22492]
+
Tue Jan 6 14:53:14 2004 Dave Thomas <dave@pragprog.com>
* bin/ri: split out the display side, making it pluggable. Added
@@ -20,7 +25,7 @@ Tue Jan 6 06:37:53 2004 Dave Thomas <dave@pragprog.com>
Tue Jan 6 00:04:40 2004 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
+ * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
fix parsing if there are braces in a method parameter list
Tue Jan 6 06:37:53 2004 Dave Thomas <dave@pragprog.com>
@@ -40,21 +45,21 @@ Tue Jan 6 06:37:53 2004 Dave Thomas <dave@pragprog.com>
Tue Jan 6 00:04:40 2004 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
+ * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
fix parsing if there are braces in a method parameter list
Tue Jan 6 00:04:40 2004 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
+ * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
fix parsing if there are braces in a method parameter list
Tue Jan 6 00:04:40 2004 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
+ * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
fix parsing if there are braces in a method parameter list
Fri Jan 2 14:54:11 2004 Dave Thomas <dave@pragprog.com>
-
+
* bin/ri: Add new --classes option, and arrange for
help messages to be paged too.
@@ -62,7 +67,7 @@ Fri Jan 2 14:54:11 2004 Dave Thomas <dave@pragprog.com>
* process.c: (MG) Added Process documentation
- * lib/rdoc/ri/ri_formatter.rb (RI::AttributeFormatter::wrap):
+ * lib/rdoc/ri/ri_formatter.rb (RI::AttributeFormatter::wrap):
Fix problem with labels not displaying in RI labeled
lists using BS and ANSI modes.
@@ -91,8 +96,8 @@ Tue Dec 30 12:30:30 2003 Dave Thomas <dave@pragprog.com>
Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
- Handle undoing nesting of yield parameters correctly for:
+ * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
+ Handle undoing nesting of yield parameters correctly for:
def each_entry(&b) Dir.foreach(@path) {|f| yield P.new(f) } end
@@ -150,7 +155,7 @@ Sun Dec 28 08:56:51 2003 Dave Thomas <dave@pragprog.com>
Sun Dec 28 03:50:05 2003 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_override_comment):
+ * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_override_comment):
Escape method names used in regexp
Sun Dec 28 01:46:02 2003 Dave Thomas <dave@pragprog.com>
diff --git a/io.c b/io.c
index 73423411c9..6b1dd4c275 100644
--- a/io.c
+++ b/io.c
@@ -1726,12 +1726,12 @@ fptr_finalize(fptr, noraise)
OpenFile *fptr;
int noraise;
{
- int n1 = 0, n2 = 0, e = 0, f1, f2 = -1;
+ int n1 = 0, n2 = 0, f1, f2 = -1;
if (fptr->f2) {
f2 = fileno(fptr->f2);
- while ((n2 = fclose(fptr->f2)) < 0) {
- e = errno;
+ while (n2 = 0, fclose(fptr->f2) < 0) {
+ n2 = errno;
if (!rb_io_wait_writable(f2)) {
break;
}
@@ -1741,18 +1741,19 @@ fptr_finalize(fptr, noraise)
}
if (fptr->f) {
f1 = fileno(fptr->f);
- while ((n1 = fclose(fptr->f)) < 0) {
+ while (n1 = 0, fclose(fptr->f) < 0) {
+ n1 = errno;
if (f2 != -1 || !(fptr->mode & FMODE_WBUF)) break;
if (!rb_io_wait_writable(f1)) break;
if (!fptr->f) break;
}
fptr->f = 0;
- if (n1 < 0 && errno == EBADF && f1 == f2) {
+ if (n1 == EBADF && f1 == f2) {
n1 = 0;
}
}
- if (!noraise && (n1 < 0 || n2 < 0)) {
- if (n1 == 0) errno = e;
+ if (!noraise && (n1 || n2)) {
+ errno = (n1 ? n1 : n2);
rb_sys_fail(fptr->path);
}
}