aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-06-28 13:12:16 +0200
committerFlorian Weimer <fweimer@redhat.com>2018-06-28 13:12:16 +0200
commitc1c2848b572ea7f92b7fa81dd5b1b9ef7c69b83b (patch)
treeb885115bbd5fe2ffb52bd44ef27c810106963195
parent86a0f56158bd9cbaf2d640e2e6c66539f4cbbcc1 (diff)
downloadglibc-c1c2848b572ea7f92b7fa81dd5b1b9ef7c69b83b.tar
glibc-c1c2848b572ea7f92b7fa81dd5b1b9ef7c69b83b.tar.gz
glibc-c1c2848b572ea7f92b7fa81dd5b1b9ef7c69b83b.tar.bz2
glibc-c1c2848b572ea7f92b7fa81dd5b1b9ef7c69b83b.zip
Use _STRUCT_TIMESPEC as guard in <bits/types/struct_timespec.h> [BZ #23349]
After commit d76d3703551a362b472c866b5b6089f66f8daa8e ("Fix missing timespec definition for sys/stat.h (BZ #21371)") in combination with kernel UAPI changes, GCC sanitizer builds start to fail due to a conflicting definition of struct timespec in <linux/time.h>. Use _STRUCT_TIMESPEC as the header file inclusion guard, which is already checked in the kernel header, to support including <linux/time.h> and <sys/stat.h> in the same translation unit.
-rw-r--r--ChangeLog6
-rw-r--r--time/bits/types/struct_timespec.h5
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a585e1e16..25e824faca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-28 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #23349]
+ * time/bits/types/struct_timespec.h: Change header inclusion guard to
+ _STRUCT_TIMESPEC.
+
2018-06-28 Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
* sysdeps/ieee754/ldbl-128ibm-compat/Versions: Add __strfromieee128,
diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h
index 644db9fdb6..5b77c52b4f 100644
--- a/time/bits/types/struct_timespec.h
+++ b/time/bits/types/struct_timespec.h
@@ -1,5 +1,6 @@
-#ifndef __timespec_defined
-#define __timespec_defined 1
+/* NB: Include guard matches what <linux/time.h> uses. */
+#ifndef _STRUCT_TIMESPEC
+#define _STRUCT_TIMESPEC 1
#include <bits/types.h>