summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-20 09:29:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-20 09:29:41 +0000
commit5b615c70eb68177075bf033384499a2eb4b765e6 (patch)
tree1fde7e1854c2299962d04be1efd8055c1758c96f /marshal.c
parent96d28f71d93bd654a7a01d496ad43e1be6fcfe1f (diff)
* io.c (rb_io_fwrite): separated from io_write().
* marshal.c (w_byten): use rb_io_fwrite() to support non-blocking IO, and added error check. * rubyio.h: prototypes; rb_io_fwrite git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index 25d08ac..e90879a 100644
--- a/marshal.c
+++ b/marshal.c
@@ -102,7 +102,8 @@ w_byten(s, n, arg)
struct dump_arg *arg;
{
if (arg->fp) {
- fwrite(s, 1, n, arg->fp);
+ if (rb_io_fwrite(s, n, arg->fp) < 0)
+ rb_sys_fail(0);
}
else {
VALUE buf = arg->str;