summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-04-17 08:26:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-04-17 08:26:13 +0000
commit1c293eea0871979f65717597f7209360c0e0be7b (patch)
tree977a5c5463610a629a89acac073f1d2d5495c2cd /io.c
parentd4527f8b86c441603cba416bf1df43403cbbbe3c (diff)
* eval.c (safe_getter): should use INT2NUM().
* bignum.c (rb_big2long): 2**31 cannot fit in 31 bit long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/io.c b/io.c
index 56dd9f39f3..79118b073a 100644
--- a/io.c
+++ b/io.c
@@ -1367,7 +1367,8 @@ rb_fopen(fname, mode)
}
}
#ifdef USE_SETVBUF
- setvbuf(file, NULL, _IOFBF, 0);
+ if (setvbuf(file, NULL, _IOFBF, 0) != 0)
+ rb_warn("setvbuf() can't be honered for %s", fname);
#endif
#ifdef __human68k__
fmode(file, _IOTEXT);
@@ -1393,7 +1394,8 @@ rb_fdopen(fd, mode)
}
}
#ifdef USE_SETVBUF
- setvbuf(file, NULL, _IOFBF, 0);
+ if (setvbuf(file, NULL, _IOFBF, 0) != 0)
+ rb_warn("setvbuf() can't be honered (fd=%d)", fd);
#endif
return file;
@@ -1920,6 +1922,10 @@ rb_io_reopen(argc, argv, file)
if (freopen(RSTRING(fname)->ptr, mode, fptr->f) == 0) {
rb_sys_fail(fptr->path);
}
+#ifdef USE_SETVBUF
+ if (setvbuf(fptr->f, NULL, _IOFBF, 0) != 0)
+ rb_warn("setvbuf() can't be honered for %s", RSTRING(fname)->ptr);
+#endif
if (fptr->f2) {
if (freopen(RSTRING(fname)->ptr, "w", fptr->f2) == 0) {