diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-14 17:42:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-14 17:42:27 +0000 |
commit | 48046586497d50c99c185a11b19cbe1d3a5d1a86 (patch) | |
tree | 7b30ffdd34c21b085bdd50f4da7ad65ffab492ea | |
parent | 82f631ac5740af938ccb3ee5f05f3463e0e44854 (diff) | |
download | ruby-48046586497d50c99c185a11b19cbe1d3a5d1a86.tar.gz |
* configure.in (ftruncate): check if available.
* file.c (rb_file_truncate): check if ftruncate instead of truncate.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | file.c | 2 |
3 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Fri Feb 15 02:42:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * configure.in (ftruncate): check if available. + + * file.c (rb_file_truncate): check if ftruncate instead of truncate. + Fri Feb 15 02:40:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * configure.in (sigsetmask): check when signal semantics is not POSIX. diff --git a/configure.in b/configure.in index b9e43de276..88e25a7cdf 100644 --- a/configure.in +++ b/configure.in @@ -652,8 +652,8 @@ AC_REPLACE_FUNCS(dup2 memmove strerror strftime\ isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \ strlcpy strlcat) AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall chroot fsync getcwd eaccess\ - truncate chsize times utimes utimensat fcntl lockf lstat\ - link symlink readlink\ + truncate ftruncate chsize times utimes utimensat fcntl lockf lstat\ + link symlink readlink\ setitimer setruid seteuid setreuid setresuid setproctitle socketpair\ setrgid setegid setregid setresgid issetugid pause lchown lchmod\ getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\ @@ -3173,7 +3173,7 @@ rb_file_truncate(VALUE obj, VALUE len) rb_raise(rb_eIOError, "not opened for writing"); } rb_io_flush(obj); -#ifdef HAVE_TRUNCATE +#ifdef HAVE_FTRUNCATE if (ftruncate(fptr->fd, pos) < 0) rb_sys_fail(fptr->path); #else |