Second attempt unzip mail archives patch

This commit is contained in:
Michiel Broek 2002-02-15 19:29:33 +00:00
parent 6e31daa907
commit 509b9bbc2b
2 changed files with 39 additions and 30 deletions

View File

@ -4610,6 +4610,9 @@ v0.33.20 10-Feb-2002
from a uplink which has a echomail taglist in one of the
mailgroups defined. The area is created with the defaults
from the mailgroup.
If mbfido fails to unzip a incoming mailarchive, a second
attempt is done after a sync() and one second delay. This
seems to be a kernel flush problem.
mball:
Will not crash anymore when it needs more then 10 minutes to

View File

@ -164,14 +164,20 @@ int unpack(char *fn)
return 1;
}
rc = execute(cmd,fn,(char *)NULL,(char*)"/dev/null",(char*)"/dev/null",(char*)"/dev/null");
if (rc == 0)
if ((rc = execute(cmd,fn,(char *)NULL,(char*)"/dev/null",(char*)"/dev/null",(char*)"/dev/null")) == 0) {
unlink(fn);
else {
} else {
sync();
sleep(1);
Syslog('!', "Warning: unpack %s failed, trying again after sync()");
if ((rc = execute(cmd,fn,(char *)NULL,(char*)"/dev/null",(char*)"/dev/null",(char*)"/dev/null")) == 0) {
unlink(fn);
} else {
strncpy(newname,fn,sizeof(newname)-1);
strcpy(newname+8,".bad");
rename(fn,newname);
}
}
free(cmd);
funlock(ld);