[前][次][番号順一覧][スレッド一覧]

ruby-changes:19198

From: kosaki <ko1@a...>
Date: Mon, 4 Apr 2011 21:44:04 +0900 (JST)
Subject: [ruby-changes:19198] Ruby:r31237 (trunk): * io.c (rb_io_syswrite): While local FS writes are usually

kosaki	2011-04-04 21:43:28 +0900 (Mon, 04 Apr 2011)

  New Revision: 31237

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31237

  Log:
    * io.c (rb_io_syswrite): While local FS writes are usually
      buffered, the buffers can be full or the file opened with
      O_SYNC. IO#syswrite can also be used on blocking IOs
      (pipe/socket) just like IO#write.
      The patch is written by Eric Wong. [ruby-core:35554]

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31236)
+++ ChangeLog	(revision 31237)
@@ -1,3 +1,11 @@
+Mon Apr  4 21:41:26 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* io.c (rb_io_syswrite): While local FS writes are usually
+	  buffered, the buffers can be full or the file opened with
+	  O_SYNC. IO#syswrite can also be used on blocking IOs
+	  (pipe/socket) just like IO#write.
+	  The patch is written by Eric Wong. [ruby-core:35554]
+
 Mon Apr  4 11:50:40 2011  NAKAMURA Usaku  <usa@r...>
 
 	* test/test_tempfile.rb: simply ignore platform depedent testcases
Index: io.c
===================================================================
--- io.c	(revision 31236)
+++ io.c	(revision 31237)
@@ -3958,7 +3958,7 @@
         rb_io_check_closed(fptr);
     }
 
-    n = write(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
+    n = rb_write_internal(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
 
     if (n == -1) rb_sys_fail_path(fptr->pathv);
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]