diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-04 12:43:28 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-04 12:43:28 +0000 |
commit | 3ba502d5f01a39b4adfd456ffc29f0f13c106267 (patch) | |
tree | 3207da00ff4e965fccc0e8ec9c7cf842dc48e04d | |
parent | b36f8e6e13a27755b873e54aee721844b9640905 (diff) | |
download | ruby-3ba502d5f01a39b4adfd456ffc29f0f13c106267.tar.gz |
* 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | io.c | 2 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,11 @@ +Mon Apr 4 21:41:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * 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@ruby-lang.org> * test/test_tempfile.rb: simply ignore platform depedent testcases @@ -3958,7 +3958,7 @@ rb_io_syswrite(VALUE io, VALUE str) 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); |