- Added support for caching `.su` files generated by GCC flag `-fstack-usage`.
-- Configuration errors are now treated as warnings instead of fatal errors.
-
- ccache should now work with distcc's ``pump'' wrapper.
- The optional unifier is no longer disabled when the direct mode is enabled.
extension is non-standard. This should make it easier to use EDG-based
compilers (e.g. GHS) which don't understand `-MQ`.
+- ccache now treats an unreadable configuration file just like a missing
+ configuration file.
+
- Documented more pitfalls with enabling `hard_links` (`CCACHE_HARDLINK`).
- Documented caveats related to colored warnings from compilers.
conf = conf_create();
char *errmsg;
- struct stat st;
char *p = getenv("CCACHE_CONFIGPATH");
if (p) {
primary_config_path = x_strdup(p);
} else {
secondary_config_path = format("%s/ccache.conf", TO_STRING(SYSCONFDIR));
if (!conf_read(conf, secondary_config_path, &errmsg)) {
- if (stat(secondary_config_path, &st) == 0) {
- warn("%s", errmsg);
+ if (access(secondary_config_path, R_OK) == 0) {
+ // We could read the file but it contained errors.
+ fatal("%s", errmsg);
}
- // Missing config file in SYSCONFDIR is OK.
+ // A missing config file in SYSCONFDIR is OK.
free(errmsg);
}
bool should_create_initial_config = false;
if (!conf_read(conf, primary_config_path, &errmsg)) {
- if (stat(primary_config_path, &st) == 0) {
- warn("%s", errmsg);
+ if (access(primary_config_path, R_OK) == 0) {
+ // We could read the file but it contained errors.
+ fatal("%s", errmsg);
}
should_create_initial_config = true;
}
if (!conf_update_from_environment(conf, &errmsg)) {
- warn("%s", errmsg);
+ fatal("%s", errmsg);
}
if (conf->disable) {
x_exit(1);
}
-void
-warn(const char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- char msg[1000];
- vsnprintf(msg, sizeof(msg), format, ap);
- va_end(ap);
-
- cc_log("WARNING: %s", msg);
- fprintf(stderr, "ccache: warning: %s\n", msg);
-}
-
// Copy all data from fd_in to fd_out, decompressing data from fd_in if needed.
void
copy_fd(int fd_in, int fd_out)