]>
Commit | Line | Data |
---|---|---|
ba71e257 ER |
1 | utime(...,NULL) in some cases may cause truncation of sub-second portions of |
2 | timestamps. If utimes(...,NULL) is available, use it instead to avoid this | |
3 | problem. | |
4 | ||
5 | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> | |
6 | ||
7 | diff -Nuar --exclude autom4te.cache --exclude '*~' ccache-2.4.orig/ccache.c ccache-2.4/ccache.c | |
8 | --- ccache-2.4.orig/ccache.c 2004-09-13 03:38:30.000000000 -0700 | |
9 | +++ ccache-2.4/ccache.c 2006-06-09 16:29:16.695117780 -0700 | |
10 | @@ -481,7 +481,11 @@ | |
11 | return; | |
12 | } | |
13 | ||
14 | +#ifdef HAVE_UTIMES | |
15 | + utimes(stderr_file, NULL); | |
16 | +#else | |
17 | utime(stderr_file, NULL); | |
18 | +#endif | |
19 | ||
20 | if (strcmp(output_file, "/dev/null") == 0) { | |
21 | ret = 0; | |
22 | @@ -515,7 +519,11 @@ | |
23 | } | |
24 | if (ret == 0) { | |
25 | /* update the mtime on the file so that make doesn't get confused */ | |
26 | +#ifdef HAVE_UTIMES | |
27 | + utimes(output_file, NULL); | |
28 | +#else | |
29 | utime(output_file, NULL); | |
30 | +#endif | |
31 | } | |
32 | ||
33 | /* get rid of the intermediate preprocessor file */ | |
34 | diff -Nuar --exclude autom4te.cache --exclude '*~' ccache-2.4.orig/ccache.h ccache-2.4/ccache.h | |
35 | --- ccache-2.4.orig/ccache.h 2004-09-13 03:38:30.000000000 -0700 | |
36 | +++ ccache-2.4/ccache.h 2006-06-09 16:28:16.601658626 -0700 | |
37 | @@ -22,6 +22,9 @@ | |
38 | #ifdef HAVE_PWD_H | |
39 | #include <pwd.h> | |
40 | #endif | |
41 | +#ifdef HAVE_SYS_TIME_H | |
42 | +#include <sys/time.h> | |
43 | +#endif | |
44 | ||
45 | #define STATUS_NOTFOUND 3 | |
46 | #define STATUS_FATAL 4 | |
47 | diff -Nuar --exclude autom4te.cache --exclude '*~' ccache-2.4.orig/config.h.in ccache-2.4/config.h.in | |
48 | --- ccache-2.4.orig/config.h.in 2003-09-27 21:48:17.000000000 -0700 | |
49 | +++ ccache-2.4/config.h.in 2006-06-09 16:25:43.000000000 -0700 | |
50 | @@ -19,6 +19,9 @@ | |
51 | /* Define to 1 if you have the `gethostname' function. */ | |
52 | #undef HAVE_GETHOSTNAME | |
53 | ||
54 | +/* Define to 1 if you have the `getpwuid' function. */ | |
55 | +#undef HAVE_GETPWUID | |
56 | + | |
57 | /* Define to 1 if you have the <inttypes.h> header file. */ | |
58 | #undef HAVE_INTTYPES_H | |
59 | ||
60 | @@ -31,6 +34,9 @@ | |
61 | /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ | |
62 | #undef HAVE_NDIR_H | |
63 | ||
64 | +/* Define to 1 if you have the <pwd.h> header file. */ | |
65 | +#undef HAVE_PWD_H | |
66 | + | |
67 | /* Define to 1 if you have the `realpath' function. */ | |
68 | #undef HAVE_REALPATH | |
69 | ||
70 | @@ -60,6 +66,9 @@ | |
71 | /* Define to 1 if you have the <sys/stat.h> header file. */ | |
72 | #undef HAVE_SYS_STAT_H | |
73 | ||
74 | +/* Define to 1 if you have the <sys/time.h> header file. */ | |
75 | +#undef HAVE_SYS_TIME_H | |
76 | + | |
77 | /* Define to 1 if you have the <sys/types.h> header file. */ | |
78 | #undef HAVE_SYS_TYPES_H | |
79 | ||
80 | @@ -69,6 +78,9 @@ | |
81 | /* Define to 1 if you have the <unistd.h> header file. */ | |
82 | #undef HAVE_UNISTD_H | |
83 | ||
84 | +/* Define to 1 if you have the `utimes' function. */ | |
85 | +#undef HAVE_UTIMES | |
86 | + | |
87 | /* Define to 1 if you have the `vasprintf' function. */ | |
88 | #undef HAVE_VASPRINTF | |
89 | ||
90 | diff -Nuar --exclude autom4te.cache --exclude '*~' ccache-2.4.orig/configure.in ccache-2.4/configure.in | |
91 | --- ccache-2.4.orig/configure.in 2004-09-13 03:38:30.000000000 -0700 | |
92 | +++ ccache-2.4/configure.in 2006-06-09 16:25:15.541288184 -0700 | |
93 | @@ -27,10 +27,11 @@ | |
94 | AC_HEADER_TIME | |
95 | AC_HEADER_SYS_WAIT | |
96 | ||
97 | -AC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h pwd.h) | |
98 | +AC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h pwd.h sys/time.h) | |
99 | ||
100 | AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp) | |
101 | AC_CHECK_FUNCS(gethostname getpwuid) | |
102 | +AC_CHECK_FUNCS(utimes) | |
103 | ||
104 | AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [ | |
105 | AC_TRY_COMPILE( |