annotate lib/swig/swigwin-2.0.11/CCache/debian/patches/12_cachesize_permissions.diff @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 --- stats.c (révision 8804)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 +++ stats.c (copie de travail)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 @@ -286,7 +286,7 @@
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 /* set the per directory limits */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 -void stats_set_limits(long maxfiles, long maxsize)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 +int stats_set_limits(long maxfiles, long maxsize)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 int dir;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 unsigned counters[STATS_END];
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 @@ -298,7 +298,9 @@
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 maxsize /= 16;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 - create_dir(cache_dir);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 + if (create_dir(cache_dir) != 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 + return 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 + }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 /* set the limits in each directory */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 for (dir=0;dir<=0xF;dir++) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 @@ -306,7 +308,9 @@
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 int fd;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 x_asprintf(&cdir, "%s/%1x", cache_dir, dir);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 - create_dir(cdir);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 + if (create_dir(cdir) != 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 + return 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 + }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 x_asprintf(&fname, "%s/stats", cdir);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 free(cdir);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 @@ -326,6 +330,8 @@
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 free(fname);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 +
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 + return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 /* set the per directory sizes */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 --- ccache.c (révision 8804)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 +++ ccache.c (copie de travail)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 @@ -935,15 +934,23 @@
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 case 'F':
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 check_cache_dir();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 v = atoi(optarg);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 - stats_set_limits(v, -1);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 - printf("Set cache file limit to %u\n", (unsigned)v);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 + if (stats_set_limits(v, -1) == 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 + printf("Set cache file limit to %u\n", (unsigned)v);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 + } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 + printf("Could not set cache file limit.\n");
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 + exit(1);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 + }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 break;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 case 'M':
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 check_cache_dir();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 v = value_units(optarg);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 - stats_set_limits(-1, v);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 - printf("Set cache size limit to %uk\n", (unsigned)v);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 + if (stats_set_limits(-1, v) == 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 + printf("Set cache size limit to %uk\n", (unsigned)v);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 + } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 + printf("Could not set cache size limit.\n");
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 + exit(1);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 + }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 break;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 default:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 --- ccache.h (révision 8804)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 +++ ccache.h (copie de travail)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 @@ -101,7 +101,7 @@
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 void stats_summary(void);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 void stats_tocache(size_t size);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 void stats_read(const char *stats_file, unsigned counters[STATS_END]);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 -void stats_set_limits(long maxfiles, long maxsize);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 +int stats_set_limits(long maxfiles, long maxsize);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 size_t value_units(const char *s);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82 void display_size(unsigned v);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 void stats_set_sizes(const char *dir, size_t num_files, size_t total_size);