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

ruby-changes:54926

From: nobu <ko1@a...>
Date: Sun, 24 Feb 2019 20:57:24 +0900 (JST)
Subject: [ruby-changes:54926] nobu:r67131 (trunk): Check stx_btime in struct statx

nobu	2019-02-24 20:57:18 +0900 (Sun, 24 Feb 2019)

  New Revision: 67131

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67131

  Log:
    Check stx_btime in struct statx

  Modified files:
    trunk/configure.ac
    trunk/file.c
Index: configure.ac
===================================================================
--- configure.ac	(revision 67130)
+++ configure.ac	(revision 67131)
@@ -1563,6 +1563,8 @@ AC_CHECK_MEMBERS([struct stat.st_ctim]) https://github.com/ruby/ruby/blob/trunk/configure.ac#L1563
 AC_CHECK_MEMBERS([struct stat.st_ctimespec])
 AC_CHECK_MEMBERS([struct stat.st_ctimensec])
 AC_CHECK_MEMBERS([struct stat.st_birthtimespec])
+AS_IF([test "x$ac_cv_member_struct_stat_st_birthtimespec" != xyes],
+    [AC_CHECK_MEMBERS([struct statx.stx_btime])])
 
 AC_CHECK_TYPES([struct timeval], [], [], [@%:@ifdef HAVE_TIME_H
 @%:@include <time.h>
@@ -1885,19 +1887,8 @@ AC_CHECK_FUNCS(utimes) https://github.com/ruby/ruby/blob/trunk/configure.ac#L1887
 AC_CHECK_FUNCS(wait4)
 AC_CHECK_FUNCS(waitpid)
 
-AS_CASE(["$target_os"],[aix*],[ac_cv_func_statx=no],[AC_CHECK_FUNCS(statx)])
-AS_IF([test "$ac_cv_func_statx" = no], [AS_CASE(["$target_os"], [linux*],
-  [AC_CHECK_DECLS([__NR_statx], [ac_cv_func_statx=syscall], [],
-    [
-@%:@ ifdef HAVE_SYSCALL_H
-@%:@   include <syscall.h>
-@%:@ elif defined HAVE_SYS_SYSCALL_H
-@%:@   include <sys/syscall.h>
-@%:@ endif
-    ])
-  ])
-])
-AS_IF([test "$ac_cv_func_statx" = syscall], [AC_DEFINE(HAVE_STATX, 0)])
+AS_IF([test "x$ac_cv_member_struct_statx_stx_btime" = xyes],
+    [AC_CHECK_FUNCS(statx)])
 
 AS_CASE(["$ac_cv_func_memset_s:$ac_cv_func_qsort_s"], [*yes*],
     [RUBY_DEFINE_IF([!defined __STDC_WANT_LIB_EXT1__], [__STDC_WANT_LIB_EXT1__], 1)])
Index: file.c
===================================================================
--- file.c	(revision 67130)
+++ file.c	(revision 67131)
@@ -1114,9 +1114,10 @@ stat_without_gvl(const char *path, struc https://github.com/ruby/ruby/blob/trunk/file.c#L1114
 						  RUBY_UBF_IO, NULL);
 }
 
-#if !defined(HAVE_STAT_BIRTHTIME) && defined(HAVE_STATX)
+#if !defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC) && \
+    defined(HAVE_STRUCT_STATX_STX_BTIME)
 
-# if HAVE_STATX == 0
+# ifndef HAVE_STATX
 #   ifdef HAVE_SYSCALL_H
 #     include <syscall.h>
 #   elif defined HAVE_SYS_SYSCALL_H
@@ -2402,7 +2403,7 @@ rb_file_ctime(VALUE obj) https://github.com/ruby/ruby/blob/trunk/file.c#L2403
  *
  */
 
-#if defined(HAVE_STAT_BIRTHTIME) || defined(HAVE_STATX)
+#if defined(HAVE_STAT_BIRTHTIME)
 RUBY_FUNC_EXPORTED VALUE
 rb_file_s_birthtime(VALUE klass, VALUE fname)
 {

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

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