head	1.2;
access;
symbols
	RELEASE_8_1_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2010.11.22.05.47.08;	author stas;	state dead;
branches;
next	1.1;

1.1
date	2010.04.28.23.59.55;	author stas;	state Exp;
branches;
next	;


desc
@@


1.2
log
@- Update ruby 1.8 to p302.

PR:		ports/151712
Reported by:	Pavel Argentov <argentoff@@gmail.com>
@
text
@Index: io.c
===================================================================
--- io.c	(revision 26252)
+++ io.c	(revision 26253)
@@@@ -122,6 +122,9 @@@@
 # endif
 #endif
 
+#define preserving_errno(stmts) \
+	do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
+
 VALUE rb_cIO;
 VALUE rb_eEOFError;
 VALUE rb_eIOError;
@@@@ -490,7 +493,7 @@@@
 	r = write(fileno(f), RSTRING(str)->ptr+offset, l);
         TRAP_END;
 #if BSD_STDIO
-	fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET);
+	preserving_errno(fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET));
 #endif
         if (r == n) return len;
         if (0 <= r) {
@


1.1
log
@- Fix incorrect errno returned by IO::write.

Reported by:	John-Paul Bader <contact@@smyck.org>
Obtained from:	ruby svn (revision r26253)
@
text
@@

