... | ... |
@@ -170,12 +170,15 @@ static int mirman_update_int(uint32_t *ip, int af, struct mirdat *mdat, uint8_t |
170 | 170 |
if(found) { |
171 | 171 |
mdat->mirtab[i].atime = 0; /* will be updated in mirman_write() */ |
172 | 172 |
if(succ || fail) { |
173 |
- mdat->mirtab[i].fail += fail; |
|
174 |
- if(mdat->mirtab[i].fail < 0) |
|
173 |
+ if((int) mdat->mirtab[i].fail + fail < 0) |
|
175 | 174 |
mdat->mirtab[i].fail = 0; |
176 |
- mdat->mirtab[i].succ += succ; |
|
177 |
- if(mdat->mirtab[i].succ < 0) |
|
175 |
+ else |
|
176 |
+ mdat->mirtab[i].fail += fail; |
|
177 |
+ |
|
178 |
+ if((int) mdat->mirtab[i].succ + succ < 0) |
|
178 | 179 |
mdat->mirtab[i].succ = 0; |
180 |
+ else |
|
181 |
+ mdat->mirtab[i].succ += succ; |
|
179 | 182 |
} else { |
180 | 183 |
if(broken) |
181 | 184 |
mdat->mirtab[i].fail++; |
... | ... |
@@ -59,7 +59,7 @@ int clamd_connect(const char *cfgfile, const char *option) |
59 | 59 |
#endif |
60 | 60 |
struct optstruct *opts; |
61 | 61 |
const struct optstruct *opt; |
62 |
- int sockd, bread; |
|
62 |
+ int sockd; |
|
63 | 63 |
const char *socktype; |
64 | 64 |
|
65 | 65 |
|
... | ... |
@@ -188,7 +188,6 @@ int notify(const char *cfgfile) |
188 | 188 |
{ |
189 | 189 |
char buff[20]; |
190 | 190 |
int sockd, bread; |
191 |
- const char *socktype; |
|
192 | 191 |
|
193 | 192 |
if((sockd = clamd_connect(cfgfile, "NotifyClamd")) < 0) |
194 | 193 |
return 1; |