Package: time / 1.9-0.1

time-include-time_h.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Search for time.h, and use it in !HAVE_WAIT3 case.
 This helps getting a correct define for HZ when wait3 is detected to not be
 properly filling in rusage.
Author: Pino Toscano

--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,7 @@ AC_SUBST([WARN_CFLAGS])
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(time.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
--- a/src/resuse.c
+++ b/src/resuse.c
@@ -28,6 +28,9 @@
 
 #if !HAVE_WAIT3
 # include <sys/times.h>
+# if HAVE_TIME_H
+#  include <time.h>
+# endif
 # ifndef HZ
 #  include <sys/param.h>
 # endif