Line 0
Link Here
|
|
|
1 |
--- mgstat.c.orig Wed Jul 20 00:56:00 2005 |
2 |
+++ mgstat.c Wed Jul 20 01:01:07 2005 |
3 |
@@ -96,7 +96,7 @@ |
4 |
struct list_head *h; |
5 |
struct year_t *t; |
6 |
|
7 |
- debug(5, __FUNCTION__ ": looking for %d\n", year); |
8 |
+ debug(5, "%s: looking for %d\n", __FUNCTION__, year); |
9 |
list_for_each(h, &years_l) { |
10 |
t = list_entry(h, struct year_t, head); |
11 |
if(t->year == year) return t; |
12 |
@@ -113,7 +113,7 @@ |
13 |
list_add(&t->head, &years_l); |
14 |
INIT_LIST_HEAD(&t->months); |
15 |
|
16 |
- debug(5, __FUNCTION__ ": %d year added.\n", year); |
17 |
+ debug(5, "%s: %d year added.\n", __FUNCTION__, year); |
18 |
|
19 |
return t; |
20 |
} |
21 |
@@ -130,7 +130,7 @@ |
22 |
INIT_LIST_HEAD(&t->days); |
23 |
months_nr++; |
24 |
|
25 |
- debug(5, __FUNCTION__ ": searching for %s %d\n", s, year); |
26 |
+ debug(5, "%s: searching for %s %d\n", __FUNCTION__, s, year); |
27 |
|
28 |
if(!(y = find_year(year))) y = new_year(year); |
29 |
y->nr_months++; |
30 |
@@ -156,9 +156,9 @@ |
31 |
} |
32 |
t = new_entry(day, head); |
33 |
cur_day = t; |
34 |
- debug(5, __FUNCTION__ ": %d day created\n", day); |
35 |
+ debug(5, "%s: %d day created\n", __FUNCTION__, day); |
36 |
FOUND: |
37 |
- debug(5, __FUNCTION__ ": %d day found - %lld\n", day, t->req_c); |
38 |
+ debug(5, "%s: %d day found - %lld\n", __FUNCTION__, day, t->req_c); |
39 |
cur_day = t; |
40 |
return t; |
41 |
} |
42 |
@@ -186,7 +186,7 @@ |
43 |
FOUND: |
44 |
cur_month = t; |
45 |
cur_day = 0; |
46 |
- debug(5, __FUNCTION__ ": FOUND %s %s %d\n", t->month, month, year); |
47 |
+ debug(5, "%s: FOUND %s %s %d\n", __FUNCTION__, t->month, month, year); |
48 |
return find_day(day, &t->days); |
49 |
} |
50 |
|
51 |
@@ -223,7 +223,7 @@ |
52 |
return; |
53 |
} |
54 |
e->req_c++; |
55 |
- debug(2, __FUNCTION__ ": req increased for %d (%lld)\n", |
56 |
+ debug(2, "%s: req increased for %d (%lld)\n", __FUNCTION__, |
57 |
e->day, e->req_c); |
58 |
if(!(t = strstr(s, MOD_GZIP_ID))) return; |
59 |
id = t; |
60 |
@@ -237,7 +237,7 @@ |
61 |
for(i = 0; i < sizeof gzip_ok/sizeof(char *); i++) |
62 |
if(!strncmp(t, gzip_ok[i], strlen(gzip_ok[i]))) goto FOUND; |
63 |
e->ncomp_c++; |
64 |
- debug(2, __FUNCTION__ "non compressed req - %lld\n", e->ncomp_c); |
65 |
+ debug(2, "%snon compressed req - %lld\n", __FUNCTION__, e->ncomp_c); |
66 |
while(*--id == ' ') ; |
67 |
if(!isdigit((int)*id)) { |
68 |
#ifdef DEBUG |
69 |
@@ -622,7 +622,7 @@ |
70 |
if (!strcasecmp(log_file, "-")) f = stdin; |
71 |
else f = fopen(log_file, "r"); |
72 |
|
73 |
- if(!f) errx(1, __FUNCTION__ ": cannot open log file %s: %s", |
74 |
+ if(!f) errx(1, "%s: cannot open log file %s: %s", __FUNCTION__, |
75 |
log_file, strerror(errno)); |
76 |
read_hist(mk_filename(out_dir, MG_HIST, 0)); |
77 |
//dump_list(); exit(0); |
78 |
--- output.c.orig Wed Jul 20 01:01:11 2005 |
79 |
+++ output.c Wed Jul 20 01:02:17 2005 |
80 |
@@ -205,7 +205,7 @@ |
81 |
if(!strncasecmp(m_name[i], m, 3)) |
82 |
return i+1; |
83 |
} |
84 |
- errx(1, __FUNCTION__ ": Invalid month name %s", m); |
85 |
+ errx(1, "%s: Invalid month name %s", __FUNCTION__, m); |
86 |
return 0; |
87 |
} |
88 |
|
89 |
@@ -263,7 +263,7 @@ |
90 |
} |
91 |
p++; |
92 |
} |
93 |
- errx(1, __FUNCTION__": internal error - unknown month %s.", m->month); |
94 |
+ errx(1, "%s: internal error - unknown month %s.", __FUNCTION__, m->month); |
95 |
return 0; |
96 |
} |
97 |
|
98 |
@@ -304,10 +304,10 @@ |
99 |
else if(!gethostname(buf, sizeof buf)) tmp = buf; |
100 |
else tmp = "localhost"; |
101 |
tab = calloc(h->nr_months, sizeof m); |
102 |
- if(!tab) errx(1, __FUNCTION__ ": Cannot allocate memory."); |
103 |
+ if(!tab) errx(1, "%s: Cannot allocate memory.", __FUNCTION__); |
104 |
list_for_each_r(x, &h->months) { |
105 |
m = list_entry(x, struct month_t, l_year); |
106 |
- if(i > h->nr_months) errx(1, __FUNCTION__ ": Internal error."); |
107 |
+ if(i > h->nr_months) errx(1, "%s: Internal error.", __FUNCTION__); |
108 |
tab[i] = m; |
109 |
get_max(&m->days); |
110 |
i++; |
111 |
@@ -376,9 +376,9 @@ |
112 |
#endif |
113 |
max_r = max = total = max_all_b = 0; |
114 |
tab = calloc(m->nr_days, sizeof t); |
115 |
- if(!tab) errx(1, __FUNCTION__ ": Cannot allocate memory."); |
116 |
+ if(!tab) errx(1, ": Cannot allocate memory.", __FUNCTION__); |
117 |
list_for_each_r(x, &m->days) { |
118 |
- if(i == 31) errx(1, __FUNCTION__ ": internal error: too many days."); |
119 |
+ if(i == 31) errx(1, "%s: internal error: too many days.", __FUNCTION__); |
120 |
t = list_entry(x, struct entry_t, l_month); |
121 |
tab[i] = t; |
122 |
i++; |
123 |
--- graph.c.orig Wed Jul 20 01:02:20 2005 |
124 |
+++ graph.c Wed Jul 20 01:02:47 2005 |
125 |
@@ -35,7 +35,7 @@ |
126 |
{ |
127 |
struct gd_image *p; |
128 |
p = calloc(1, sizeof *p); |
129 |
- if(!p) errx(1, __FUNCTION__ ": cannot allocate memory."); |
130 |
+ if(!p) errx(1, "%s: cannot allocate memory.", __FUNCTION__); |
131 |
return p; |
132 |
} |
133 |
|
134 |
@@ -127,7 +127,7 @@ |
135 |
gdImageRectangle(g->im, G_MARG_X-1, G_MARG_Y-2, G_END_X, G_END_Y+1, g->colors[GRAY]); |
136 |
snprintf(buf, sizeof buf, "%s/%s", out_dir, s); |
137 |
f = fopen(buf, "wb"); |
138 |
- if(!f) errx(1, __FUNCTION__ ": cannot open %s: %s", buf, strerror(errno)); |
139 |
+ if(!f) errx(1, "%s: cannot open %s: %s", __FUNCTION__, buf, strerror(errno)); |
140 |
#ifdef HAVE_GD_GIF |
141 |
gdImageGif(g->im, f); |
142 |
#else |
143 |
@@ -137,7 +137,7 @@ |
144 |
gdImageDestroy(g->im); |
145 |
free(g); |
146 |
#ifdef DEBUG |
147 |
- printf(__FUNCTION__": Writing %s\n", s); |
148 |
+ printf("%s: Writing %s\n", __FUNCTION__, s); |
149 |
#endif |
150 |
} |
151 |
|