aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-04-17 10:38:53 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-04-20 17:09:17 -0300
commitd76d3703551a362b472c866b5b6089f66f8daa8e (patch)
tree853654a13ec3e23de62868190033df47861c4fef
parenta0704b1ac7e8dc26f0e0feac58468958305ae844 (diff)
downloadglibc-d76d3703551a362b472c866b5b6089f66f8daa8e.zip
glibc-d76d3703551a362b472c866b5b6089f66f8daa8e.tar.gz
glibc-d76d3703551a362b472c866b5b6089f66f8daa8e.tar.bz2
Fix missing timespec definition for sys/stat.h (BZ #21371)
As indicated by the bug report, the 'struct timespec' definition is not defined for '_XOPEN_SOURCE=700' and '_POSIX_C_SOURCE=200112L'. It is because current code only includes its definition if __USE_ATFILE is defined and the define is only set with: 1. _GNU_SOURCE and/or _ATFILE_SOURCE definition. 2. _POSIX_C_SOURCE >= 200809L However, the 'st_*' fields in 'struct stat' are defined if __USE_XOPEN2K8. This patch uses the same logic for 'struct timespec' inclusion. Tested on x86_64-linux-gnu. * io/sys/stat.h: Use __USE_XOPEN2K8 insteaf of __USE_ATFILE for struct timespec definition.
-rw-r--r--ChangeLog5
-rw-r--r--io/sys/stat.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d6183d..31b56a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-20 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * io/sys/stat.h: Use __USE_XOPEN2K8 insteaf of __USE_ATFILE for
+ struct timespec definition.
+
2017-04-19 Florian Weimer <fweimer@redhat.com>
* resolv/nss_dns/dns-host.c (getanswer_r): Fix parentheses.
diff --git a/io/sys/stat.h b/io/sys/stat.h
index 2ada4a5..ac7ef1f 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -26,7 +26,7 @@
#include <bits/types.h> /* For __mode_t and __dev_t. */
-#ifdef __USE_ATFILE
+#ifdef __USE_XOPEN2K8
# include <bits/types/struct_timespec.h>
#endif