1From bf1eafb07297711baf9320b1edcca8a3376f117d Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Wed, 18 Nov 2015 09:03:00 +0000
4Subject: [PATCH] Use configure test for struct timespec
5
6Use the configure script to test for struct time spec instead of trying
7to keep track of what platforms has it.
8
9Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
10[Retrieved from:
11http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-test-for-struct-timespec.patch?h=sumo]
12Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
13---
14 open-vm-tools/configure.ac           | 1 +
15 open-vm-tools/lib/include/hgfsUtil.h | 8 +-------
16 2 files changed, 2 insertions(+), 7 deletions(-)
17
18Index: open-vm-tools/configure.ac
19===================================================================
20--- open-vm-tools.orig/configure.ac
21+++ open-vm-tools/configure.ac
22@@ -1127,6 +1127,7 @@ AC_TYPE_OFF_T
23 AC_TYPE_PID_T
24 AC_TYPE_SIZE_T
25 AC_CHECK_MEMBERS([struct stat.st_rdev])
26+AC_CHECK_MEMBERS([struct timespec.tv_sec],[],[],[[#include <time.h>]])
27 AC_HEADER_TIME
28 AC_STRUCT_TM
29 AC_C_VOLATILE
30Index: open-vm-tools/lib/include/hgfsUtil.h
31===================================================================
32--- open-vm-tools.orig/lib/include/hgfsUtil.h
33+++ open-vm-tools/lib/include/hgfsUtil.h
34@@ -53,13 +53,7 @@
35 #      include <time.h>
36 #   endif
37 #   include "vm_basic_types.h"
38-#   if !defined _STRUCT_TIMESPEC &&   \
39-       !defined _TIMESPEC_DECLARED && \
40-       !defined __timespec_defined && \
41-       !defined sun && \
42-       !defined __FreeBSD__ && \
43-       !__APPLE__ && \
44-       !defined _WIN32
45+#   if !defined HAVE_STRUCT_TIMESPEC_TV_SEC
46 struct timespec {
47    time_t tv_sec;
48    long   tv_nsec;
49