From 620cbfd46681582c003b8c5103b5135ee80c38a6 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 25 Jun 2004 15:13:16 +0000 Subject: * io.c (rb_fopen, rb_fdopen, rb_io_reopen): setvbuf() may return positive value on failure. [ruby-dev:23792] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index c0cf821b8b..f71ef8f0b6 100644 --- a/io.c +++ b/io.c @@ -2381,7 +2381,7 @@ rb_fopen(fname, mode) } } #ifdef USE_SETVBUF - if (setvbuf(file, NULL, _IOFBF, 0) < 0) + if (setvbuf(file, NULL, _IOFBF, 0) != 0) rb_warn("setvbuf() can't be honoured for %s", fname); #endif #ifdef __human68k__ @@ -2424,7 +2424,7 @@ rb_fdopen(fd, mode) } #ifdef USE_SETVBUF - if (setvbuf(file, NULL, _IOFBF, 0) < 0) + if (setvbuf(file, NULL, _IOFBF, 0) != 0) rb_warn("setvbuf() can't be honoured (fd=%d)", fd); #endif return file; @@ -3278,7 +3278,7 @@ rb_io_reopen(argc, argv, file) rb_sys_fail(fptr->path); } #ifdef USE_SETVBUF - if (setvbuf(fptr->f, NULL, _IOFBF, 0) < 0) + if (setvbuf(fptr->f, NULL, _IOFBF, 0) != 0) rb_warn("setvbuf() can't be honoured for %s", RSTRING(fname)->ptr); #endif -- cgit v1.2.3