cc_log("=== CCACHE STARTED =========================================");
- /* the user might have set CCACHE_UMASK */
- p = getenv("CCACHE_UMASK");
- if (p) {
- mode_t mask;
- errno = 0;
- mask = strtol(p, NULL, 8);
- if (errno == 0) {
- umask(mask);
- }
+ if (conf->umask != UINT_MAX) {
+ umask(conf->umask);
}
current_working_dir = get_cwd();
conf->sloppiness = 0;
conf->stats = true;
conf->temporary_dir = x_strdup("");
- conf->umask = 0;
+ conf->umask = UINT_MAX; /* default: don't set umask */
conf->unify = false;
return conf;
}
/*
- * Copyright (C) 2010 Joel Rosdahl
+ * Copyright (C) 2010-2011 Joel Rosdahl
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
+#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
CHECK_UNS_EQ(0, conf->sloppiness);
CHECK(conf->stats);
CHECK_STR_EQ("", conf->temporary_dir);
- CHECK_UNS_EQ(0, conf->umask);
+ CHECK_UNS_EQ(UINT_MAX, conf->umask);
CHECK(!conf->unify);
conf_free(conf);
}