[前][次][番号順一覧][スレッド一覧]

ruby-changes:19772

From: yugui <ko1@a...>
Date: Mon, 30 May 2011 13:44:56 +0900 (JST)
Subject: [ruby-changes:19772] yugui:r31817 (ruby_1_9_2): merges r31351 and r31352 from trunk into ruby_1_9_2.

yugui	2011-05-30 13:44:42 +0900 (Mon, 30 May 2011)

  New Revision: 31817

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31817

  Log:
    merges r31351 and r31352 from trunk into ruby_1_9_2.
    --
    * include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64
      versions on mingw are useless because they use int32_t.  fixes #4564
    --
    * file.c (rb_file_truncate): fix function.

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/configure.in
    branches/ruby_1_9_2/file.c
    branches/ruby_1_9_2/include/ruby/win32.h
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/include/ruby/win32.h
===================================================================
--- ruby_1_9_2/include/ruby/win32.h	(revision 31816)
+++ ruby_1_9_2/include/ruby/win32.h	(revision 31817)
@@ -94,6 +94,9 @@
 #ifndef __MINGW32__
 # define mode_t int
 #endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
 #ifdef WIN95
 extern DWORD rb_w32_osid(void);
@@ -371,21 +374,41 @@
 
 #define SUFFIX
 
-#if !defined HAVE_FTRUNCATE || defined(_MSC_VER)
+extern int 	 rb_w32_ftruncate(int fd, off_t length);
+extern int 	 rb_w32_truncate(const char *path, off_t length);
+extern off_t	 rb_w32_ftello(FILE *stream);
+extern int 	 rb_w32_fseeko(FILE *stream, off_t offset, int whence);
+
+#undef HAVE_FTRUNCATE
+#define HAVE_FTRUNCATE 1
+#if defined HAVE_FTRUNCATE64
+#define ftruncate ftruncate64
+#else
 #define ftruncate rb_w32_ftruncate
 #endif
-extern int       ftruncate(int fd, off_t length);
 
-#if !defined HAVE_TRUNCATE || defined(_MSC_VER)
+#undef HAVE_TRUNCATE
+#define HAVE_TRUNCATE 1
+#if defined HAVE_TRUNCATE64
+#define truncate truncate64
+#else
 #define truncate rb_w32_truncate
 #endif
-extern int       truncate(const char *path, off_t length);
 
-extern int       fseeko(FILE *stream, off_t offset, int whence);
+#undef HAVE_FSEEKO
+#define HAVE_FSEEKO 1
+#if defined HAVE_FSEEKO64
+#define fseeko fseeko64
+#else
+#define fseeko rb_w32_fseeko
+#endif
 
-#if !defined HAVE_FTELLO || defined(_MSC_VER)
+#undef HAVE_FTELLO
+#define HAVE_FTELLO 1
+#if defined HAVE_FTELLO64
+#define ftello ftello64
+#else
 #define ftello rb_w32_ftello
-extern off_t     rb_w32_ftello(FILE *stream);
 #endif
 
 //
Index: ruby_1_9_2/configure.in
===================================================================
--- ruby_1_9_2/configure.in	(revision 31816)
+++ ruby_1_9_2/configure.in	(revision 31817)
@@ -1186,6 +1186,7 @@
 fi
 AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot getcwd eaccess\
 	      truncate ftruncate ftello chsize times utimes utimensat fcntl lockf lstat\
+	      truncate64 ftruncate64 ftello64 fseeko fseeko64 \
 	      link symlink readlink readdir_r fsync fdatasync fchown\
 	      setitimer setruid seteuid setreuid setresuid setproctitle socketpair\
 	      setrgid setegid setregid setresgid issetugid pause lchown lchmod\
Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 31816)
+++ ruby_1_9_2/ChangeLog	(revision 31817)
@@ -1,3 +1,10 @@
+Wed Apr 27 00:51:01 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* file.c (rb_file_truncate): fix function.
+
+	* include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64
+	  versions on mingw are useless because they use int32_t.  fixes #4564
+
 Mon Apr 25 21:31:36 2011  Nobuhiro Iwamatsu  <iwamatsu@n...>
 
 	* ext/openssl/extconf.rb: Should check SSLv2_*method.
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 31816)
+++ ruby_1_9_2/version.h	(revision 31817)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 241
+#define RUBY_PATCHLEVEL 242
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_2/file.c
===================================================================
--- ruby_1_9_2/file.c	(revision 31816)
+++ ruby_1_9_2/file.c	(revision 31817)
@@ -3913,7 +3913,7 @@
 	rb_sys_fail_path(fptr->pathv);
 #else /* defined(HAVE_CHSIZE) */
     if (chsize(fptr->fd, pos) < 0)
-	rb_sys_fail(fptr->pathv);
+	rb_sys_fail_path(fptr->pathv);
 #endif
     return INT2FIX(0);
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]