aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-05-25 20:55:31 -0700
committerLaurent Vivier <laurent@vivier.eu>2021-06-20 16:40:11 +0200
commitfebf6fade63801ebca765797fa2ad9de8d9f2700 (patch)
treec7f4343f90beac729d0260d7b4bd64fd8381890a
parent8a589aeb271bb470884f960e76cd6a7c89c022c9 (diff)
downloadqemu-febf6fade63801ebca765797fa2ad9de8d9f2700.zip
qemu-febf6fade63801ebca765797fa2ad9de8d9f2700.tar.gz
qemu-febf6fade63801ebca765797fa2ad9de8d9f2700.tar.bz2
linux-user: Fix incorrect use of feature-test-macros
The _POSIX_C_SOURCE and _XOPEN_SOURCE macros are used by the application to indicate to libc which declarations it should expose. Since qemu does not define them anywhere, it does not make sense to check their value. Instead, since the intent is to determine whether the host struct stat supports the st_*tim fields, use the configure test result which does exactly that. Signed-off-by: Michael Forney <mforney@mforney.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20210526035531.7871-1-mforney@mforney.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
-rw-r--r--linux-user/syscall.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 723cb02..70ae888 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7482,7 +7482,7 @@ static inline abi_long host_to_target_stat64(void *cpu_env,
__put_user(host_st->st_atime, &target_st->target_st_atime);
__put_user(host_st->st_mtime, &target_st->target_st_mtime);
__put_user(host_st->st_ctime, &target_st->target_st_ctime);
-#if _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
__put_user(host_st->st_atim.tv_nsec, &target_st->target_st_atime_nsec);
__put_user(host_st->st_mtim.tv_nsec, &target_st->target_st_mtime_nsec);
__put_user(host_st->st_ctim.tv_nsec, &target_st->target_st_ctime_nsec);
@@ -7517,7 +7517,7 @@ static inline abi_long host_to_target_stat64(void *cpu_env,
__put_user(host_st->st_atime, &target_st->target_st_atime);
__put_user(host_st->st_mtime, &target_st->target_st_mtime);
__put_user(host_st->st_ctime, &target_st->target_st_ctime);
-#if _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
__put_user(host_st->st_atim.tv_nsec, &target_st->target_st_atime_nsec);
__put_user(host_st->st_mtim.tv_nsec, &target_st->target_st_mtime_nsec);
__put_user(host_st->st_ctim.tv_nsec, &target_st->target_st_ctime_nsec);
@@ -10072,8 +10072,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
__put_user(st.st_atime, &target_st->target_st_atime);
__put_user(st.st_mtime, &target_st->target_st_mtime);
__put_user(st.st_ctime, &target_st->target_st_ctime);
-#if (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) && \
- defined(TARGET_STAT_HAVE_NSEC)
+#if defined(HAVE_STRUCT_STAT_ST_ATIM) && defined(TARGET_STAT_HAVE_NSEC)
__put_user(st.st_atim.tv_nsec,
&target_st->target_st_atime_nsec);
__put_user(st.st_mtim.tv_nsec,