mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-10 15:10:11 +08:00
Fix warnings
This commit is contained in:
parent
49a61affb7
commit
717ca8ae62
@ -215,7 +215,7 @@ void dumpcounters(struct trafcount *tlin, int counterd){
|
||||
|
||||
cheader.updated = conf.time;
|
||||
lseek(counterd, 0, SEEK_SET);
|
||||
write(counterd, &cheader, sizeof(struct counter_header));
|
||||
if(write(counterd, &cheader, sizeof(struct counter_header))){}
|
||||
for(tl=tlin; tl; tl = tl->next){
|
||||
if(tl->number){
|
||||
lseek(counterd,
|
||||
@ -224,7 +224,7 @@ void dumpcounters(struct trafcount *tlin, int counterd){
|
||||
crecord.traf64 = tl->traf64;
|
||||
crecord.cleared = tl->cleared;
|
||||
crecord.updated = tl->updated;
|
||||
write(counterd, &crecord, sizeof(struct counter_record));
|
||||
if(write(counterd, &crecord, sizeof(struct counter_record))){}
|
||||
}
|
||||
if(tl->type!=NEVER && timechanged(tl->cleared, conf.time, tl->type)){
|
||||
tl->cleared = conf.time;
|
||||
@ -315,7 +315,7 @@ void cyclestep(void){
|
||||
else
|
||||
strcat((char *)tmpbuf, (char *)conf.archiver[i]);
|
||||
}
|
||||
system((char *)tmpbuf+1);
|
||||
if(system((char *)tmpbuf+1)){}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
src/conf.c
17
src/conf.c
@ -1348,13 +1348,14 @@ static int h_ace(int argc, unsigned char **argv){
|
||||
sizeof(struct counter_header) + (tl->number - 1) * sizeof(struct counter_record),
|
||||
SEEK_SET);
|
||||
memset(&crecord, 0, sizeof(struct counter_record));
|
||||
read(conf.counterd, &crecord, sizeof(struct counter_record));
|
||||
tl->traf64 = crecord.traf64;
|
||||
tl->cleared = crecord.cleared;
|
||||
tl->updated = crecord.updated;
|
||||
if(tl->cleared < 0 || tl->cleared >= MAX_COUNTER_TIME || tl->updated < 0 || tl->updated >= MAX_COUNTER_TIME){
|
||||
fprintf(stderr, "Invalid, incompatible or corrupted counter file.\n");
|
||||
return(6);
|
||||
if(read(conf.counterd, &crecord, sizeof(struct counter_record)) == sizeof(struct counter_record)){
|
||||
tl->traf64 = crecord.traf64;
|
||||
tl->cleared = crecord.cleared;
|
||||
tl->updated = crecord.updated;
|
||||
if(tl->cleared < 0 || tl->cleared >= MAX_COUNTER_TIME || tl->updated < 0 || tl->updated >= MAX_COUNTER_TIME){
|
||||
fprintf(stderr, "Invalid, incompatible or corrupted counter file.\n");
|
||||
return(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1575,7 +1576,7 @@ static int h_chroot(int argc, unsigned char **argv){
|
||||
fprintf(stderr, "Unable to set uid %d", (int)uid);
|
||||
return(5);
|
||||
}
|
||||
chdir("/");
|
||||
if(chdir("/")){}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -32,7 +32,7 @@ char **load_string(FILE *f,int max_count_str, int *countloadstr,
|
||||
/*find start service section*/
|
||||
while(!feof(f))
|
||||
{
|
||||
fgets(tmpbuf1, 1023,f);
|
||||
if(!fgets(tmpbuf1, 1023,f)) return NULL;
|
||||
if ((strstr(tmpbuf1,start))!=NULL) { i++; break; }
|
||||
tmpbuf1[0]='\0';
|
||||
}
|
||||
@ -51,7 +51,7 @@ char **load_string(FILE *f,int max_count_str, int *countloadstr,
|
||||
i=0;
|
||||
while ( !feof(f) || i< max_count_str)
|
||||
{
|
||||
fgets(tmpbuf1, 1023,f);
|
||||
if(!fgets(tmpbuf1, 1023,f)) return NULL;
|
||||
|
||||
if ((strstr(tmpbuf1,stop))!=NULL) { break; }
|
||||
|
||||
|
||||
@ -593,7 +593,7 @@ void * adminchild(struct clientparam* param) {
|
||||
if(writable && !error){
|
||||
fflush(writable);
|
||||
#ifndef _WINCE
|
||||
ftruncate(fileno(writable), ftell(writable));
|
||||
if(ftruncate(fileno(writable), ftell(writable))){}
|
||||
#endif
|
||||
}
|
||||
printstr(&pp, error? "<h3><font color=\"red\">Config file is not writable</font></h3>Make sure you have \"writable\" command in configuration file":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user