* file.c (rb_file_s_truncate): use correct type. chsize takes
a long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
93d061a8fd
commit
96ffcf557b
@ -1,3 +1,10 @@
|
|||||||
|
Sun May 12 17:25:46 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* configure.in: removes AC_CHECK_FUNCS(truncate64) because it's
|
||||||
|
unused.
|
||||||
|
* file.c (rb_file_s_truncate): use correct type. chsize takes
|
||||||
|
a long.
|
||||||
|
|
||||||
Sun May 12 17:18:46 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Sun May 12 17:18:46 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* process.c: move '#define SPAWNV 1' to win32/Makefile.sub.
|
* process.c: move '#define SPAWNV 1' to win32/Makefile.sub.
|
||||||
|
@ -1810,7 +1810,7 @@ AC_CHECK_FUNCS(telldir)
|
|||||||
AC_CHECK_FUNCS(timegm)
|
AC_CHECK_FUNCS(timegm)
|
||||||
AC_CHECK_FUNCS(times)
|
AC_CHECK_FUNCS(times)
|
||||||
AC_CHECK_FUNCS(truncate)
|
AC_CHECK_FUNCS(truncate)
|
||||||
AC_CHECK_FUNCS(truncate64)
|
AC_CHECK_FUNCS(truncate64) # used for Win32
|
||||||
AC_CHECK_FUNCS(unsetenv)
|
AC_CHECK_FUNCS(unsetenv)
|
||||||
AC_CHECK_FUNCS(utimensat)
|
AC_CHECK_FUNCS(utimensat)
|
||||||
AC_CHECK_FUNCS(utimes)
|
AC_CHECK_FUNCS(utimes)
|
||||||
|
9
file.c
9
file.c
@ -4098,10 +4098,16 @@ rb_file_s_join(VALUE klass, VALUE args)
|
|||||||
static VALUE
|
static VALUE
|
||||||
rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
|
rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_TRUNCATE
|
||||||
|
#define NUM2POS(n) NUM2OFFT(n)
|
||||||
off_t pos;
|
off_t pos;
|
||||||
|
#else
|
||||||
|
#define NUM2POS(n) NUM2LONG(n)
|
||||||
|
long pos;
|
||||||
|
#endif
|
||||||
|
|
||||||
rb_secure(2);
|
rb_secure(2);
|
||||||
pos = NUM2OFFT(len);
|
pos = NUM2POS(len);
|
||||||
FilePathValue(path);
|
FilePathValue(path);
|
||||||
path = rb_str_encode_ospath(path);
|
path = rb_str_encode_ospath(path);
|
||||||
#ifdef HAVE_TRUNCATE
|
#ifdef HAVE_TRUNCATE
|
||||||
@ -4123,6 +4129,7 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return INT2FIX(0);
|
return INT2FIX(0);
|
||||||
|
#undef NUM2POS
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define rb_file_s_truncate rb_f_notimplement
|
#define rb_file_s_truncate rb_f_notimplement
|
||||||
|
Loading…
x
Reference in New Issue
Block a user