summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-06 10:39:57 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-06 10:39:57 +0000
commit2b785b0f3e4f902e7de29a895d1f6ae0f10c3265 (patch)
treebc1801ecbd4d1e852a5ae0a0b8202a41c7ec933b /io.c
parent23a434b3630b05781dc48e07582ed180d9661a6a (diff)
Merge changes from ruby_1_8 to reduce warnings and potentially improve
security. * mkconfig.rb: hide build path from rbconfig.rb. * util.c (ruby_strtod, dtoa): initialize more variables for error handling. * io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique), (path2class, path2module): constified. * pack.c (pack_unpack), process.c (rb_syswait): suppress warnings. * suppress warnings on cygwin, mingw and mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/io.c b/io.c
index d21970e7b7..50f4756ba3 100644
--- a/io.c
+++ b/io.c
@@ -50,6 +50,9 @@
#elif defined(HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#endif
+#ifdef __CYGWIN__
+#include <io.h>
+#endif
#if !HAVE_OFF_T && !defined(off_t)
# define off_t long
@@ -429,7 +432,10 @@ static int
wsplit_p(rb_io_t *fptr)
{
FILE *f = GetWriteFile(fptr);
+#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
int r;
+#endif
+
if (!(fptr->mode & FMODE_WSPLIT_INITIALIZED)) {
struct stat buf;
if (fstat(fileno(f), &buf) == 0 &&
@@ -1675,7 +1681,7 @@ rb_io_getline_fast(fptr, delim)
static int
rscheck(rsptr, rslen, rs)
- char *rsptr;
+ const char *rsptr;
long rslen;
VALUE rs;
{
@@ -4522,7 +4528,10 @@ next_argv()
FILE *fr = rb_fopen(fn, "r");
if (ruby_inplace_mode) {
- struct stat st, st2;
+ struct stat st;
+#ifndef NO_SAFE_RENAME
+ struct stat st2;
+#endif
VALUE str;
FILE *fw;