Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 1 | From bf9292ff9bd25467a014d6c2070805d163daa4c9 Mon Sep 17 00:00:00 2001 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | From: Natanael Copa <ncopa@alpinelinux.org> |
| 3 | Date: Wed, 18 Nov 2015 09:03:00 +0000 |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 4 | Subject: [PATCH] Use configure test for struct timespec |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 | |
| 6 | Use the configure script to test for struct time spec instead of trying |
| 7 | to keep track of what platforms has it. |
| 8 | |
| 9 | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> |
| 10 | --- |
| 11 | open-vm-tools/configure.ac | 1 + |
| 12 | open-vm-tools/lib/include/hgfsUtil.h | 8 +------- |
| 13 | 2 files changed, 2 insertions(+), 7 deletions(-) |
| 14 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 15 | diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac |
| 16 | index 713ea683..48ff1ef3 100644 |
| 17 | --- a/open-vm-tools/configure.ac |
| 18 | +++ b/open-vm-tools/configure.ac |
| 19 | @@ -1208,6 +1208,7 @@ AC_TYPE_OFF_T |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | AC_TYPE_PID_T |
| 21 | AC_TYPE_SIZE_T |
| 22 | AC_CHECK_MEMBERS([struct stat.st_rdev]) |
| 23 | +AC_CHECK_MEMBERS([struct timespec.tv_sec],[],[],[[#include <time.h>]]) |
| 24 | AC_HEADER_TIME |
| 25 | AC_STRUCT_TM |
| 26 | AC_C_VOLATILE |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 27 | diff --git a/open-vm-tools/lib/include/hgfsUtil.h b/open-vm-tools/lib/include/hgfsUtil.h |
| 28 | index 609f4c00..a3a022d4 100644 |
| 29 | --- a/open-vm-tools/lib/include/hgfsUtil.h |
| 30 | +++ b/open-vm-tools/lib/include/hgfsUtil.h |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 31 | @@ -53,13 +53,7 @@ |
| 32 | # include <time.h> |
| 33 | # endif |
| 34 | # include "vm_basic_types.h" |
| 35 | -# if !defined _STRUCT_TIMESPEC && \ |
| 36 | - !defined _TIMESPEC_DECLARED && \ |
| 37 | - !defined __timespec_defined && \ |
| 38 | - !defined sun && \ |
| 39 | - !defined __FreeBSD__ && \ |
| 40 | - !__APPLE__ && \ |
| 41 | - !defined _WIN32 |
| 42 | +# if !defined HAVE_STRUCT_TIMESPEC_TV_SEC |
| 43 | struct timespec { |
| 44 | time_t tv_sec; |
| 45 | long tv_nsec; |