Skip to content

Commit

Permalink
Correctly check for HAVE_STAT_BIRTHTIME in configure.ac checks for Sy…
Browse files Browse the repository at this point in the history
…stem.Native (#16999)

The check was done incorrectly, the include files need to be separated by newlines otherwise we would get a false negative result.

config.log contained this:

```
conftest.c:279:23: warning: extra tokens at end of #include directive [-Wextra-tokens]
#include <sys/types.h>, #include <sys/stat.h>
                      ^
                      //
```

This means that when doing File.GetCreationTime() we'd fall back to returning the last modified time.

It regressed when we switched to System.IO.File to the CoreFX implementation i.e. System.Native in 8f5cef9.

Fixes #16974
  • Loading branch information
akoeplinger committed Sep 23, 2019
1 parent bc43f32 commit 9b98db9
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions configure.ac
Expand Up @@ -3400,13 +3400,29 @@ if test x$host_win32 = xno; then
AC_CHECK_DECL(ICANON, [AC_DEFINE(HAVE_ICANON, 1, [ICANON])], [], [[#include <termios.h>]])
AC_CHECK_DECL(TCSANOW, [AC_DEFINE(HAVE_TCSANOW, 1, [TCSANOW])], [], [[#include <termios.h>]])

AC_CHECK_MEMBER(struct stat.st_birthtimespec, [AC_DEFINE(HAVE_STAT_BIRTHTIME, 1, [struct stat.st_birthtime])], [], [[#include <sys/types.h>], [#include <sys/stat.h>]])
AC_CHECK_MEMBER(struct stat.st_atimespec, [AC_DEFINE(HAVE_STAT_TIMESPEC, 1, [struct stat.st_atimespec])], [], [[#include <sys/types.h>], [#include <sys/stat.h>]])
AC_CHECK_MEMBER(struct stat.st_atim, [AC_DEFINE(HAVE_STAT_TIM, 1, [struct stat.st_atim])], [], [[#include <sys/types.h>], [#include <sys/stat.h>]])
AC_CHECK_MEMBER(struct stat.st_atimensec, [AC_DEFINE(HAVE_STAT_NSEC, 1, [struct stat.st_atimensec])], [], [[#include <sys/types.h>], [#include <sys/stat.h>]])
AC_CHECK_MEMBER(struct dirent.d_namlen, [AC_DEFINE(HAVE_DIRENT_NAME_LEN, 1, [struct dirent.d_namlen])], [], [[#include <dirent.h>]])
AC_CHECK_MEMBER(struct statfs.f_fstypename, [AC_DEFINE(HAVE_STATFS_FSTYPENAME, 1, [struct statfs.f_fstypename])], [], [[#include <sys/mount.h>]])
AC_CHECK_MEMBER(struct statvfs.f_fstypename, [AC_DEFINE(HAVE_STATVFS_FSTYPENAME, 1, [struct statvfs.f_fstypename])], [], [[#include <sys/mount.h>]])
AC_CHECK_MEMBER(struct stat.st_birthtimespec,
[AC_DEFINE(HAVE_STAT_BIRTHTIME, 1, [struct stat.st_birthtimespec])],
[],
[#include <sys/types.h>
#include <sys/stat.h>])
AC_CHECK_MEMBER(struct stat.st_atimespec,
[AC_DEFINE(HAVE_STAT_TIMESPEC, 1, [struct stat.st_atimespec])],
[],
[#include <sys/types.h>
#include <sys/stat.h>])
AC_CHECK_MEMBER(struct stat.st_atim,
[AC_DEFINE(HAVE_STAT_TIM, 1, [struct stat.st_atim])],
[],
[#include <sys/types.h>
#include <sys/stat.h>])
AC_CHECK_MEMBER(struct stat.st_atimensec,
[AC_DEFINE(HAVE_STAT_NSEC, 1, [struct stat.st_atimensec])],
[],
[#include <sys/types.h>
#include <sys/stat.h>])
AC_CHECK_MEMBER(struct dirent.d_namlen, [AC_DEFINE(HAVE_DIRENT_NAME_LEN, 1, [struct dirent.d_namlen])], [], [#include <dirent.h>])
AC_CHECK_MEMBER(struct statfs.f_fstypename, [AC_DEFINE(HAVE_STATFS_FSTYPENAME, 1, [struct statfs.f_fstypename])], [], [#include <sys/mount.h>])
AC_CHECK_MEMBER(struct statvfs.f_fstypename, [AC_DEFINE(HAVE_STATVFS_FSTYPENAME, 1, [struct statvfs.f_fstypename])], [], [#include <sys/mount.h>])

AC_MSG_CHECKING(for struct statfs)
AC_TRY_COMPILE([
Expand Down

0 comments on commit 9b98db9

Please sign in to comment.