summaryrefslogtreecommitdiff
path: root/CCache/stats.c
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2008-11-03 14:08:28 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2008-11-03 14:08:28 +0000
commit27e03f3f866a0e8653006511761ac95323d46301 (patch)
treeb8b4d86555421082e1a9fac642efd1e31608a3e0 /CCache/stats.c
parentac1b517350c7a03ea7ac0e624a03087fa5c07b5b (diff)
downloadswig-27e03f3f866a0e8653006511761ac95323d46301.tar.gz
apply debian/patches/12_cachesize_permissions.diff
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10913 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'CCache/stats.c')
-rw-r--r--CCache/stats.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/CCache/stats.c b/CCache/stats.c
index e5662fb26..ddaf768db 100644
--- a/CCache/stats.c
+++ b/CCache/stats.c
@@ -286,7 +286,7 @@ void stats_zero(void)
/* set the per directory limits */
-void stats_set_limits(long maxfiles, long maxsize)
+int stats_set_limits(long maxfiles, long maxsize)
{
int dir;
unsigned counters[STATS_END];
@@ -298,7 +298,9 @@ void stats_set_limits(long maxfiles, long maxsize)
maxsize /= 16;
}
- create_dir(cache_dir);
+ if (create_dir(cache_dir) != 0) {
+ return 1;
+ }
/* set the limits in each directory */
for (dir=0;dir<=0xF;dir++) {
@@ -306,7 +308,9 @@ void stats_set_limits(long maxfiles, long maxsize)
int fd;
x_asprintf(&cdir, "%s/%1x", cache_dir, dir);
- create_dir(cdir);
+ if (create_dir(cdir) != 0) {
+ return 1;
+ }
x_asprintf(&fname, "%s/stats", cdir);
free(cdir);
@@ -326,6 +330,8 @@ void stats_set_limits(long maxfiles, long maxsize)
}
free(fname);
}
+
+ return 0;
}
/* set the per directory sizes */