Fixed mball so that it could run longer then 10 minutes

This commit is contained in:
Michiel Broek 2002-02-12 20:03:36 +00:00
parent 6bc3cd03a7
commit fba6ec5c40
2 changed files with 197 additions and 191 deletions

View File

@ -4604,3 +4604,7 @@ v0.33.20 10-Feb-2002
In AreaMgr and FileMgr changed aka matching for area In AreaMgr and FileMgr changed aka matching for area
connections. Code cleanups. connections. Code cleanups.
mball:
Will not crash anymore when it needs more then 10 minutes to
create the allfiles and newfiles lists.

View File

@ -311,7 +311,7 @@ void Masterlist()
BotBox(np, TRUE); BotBox(np, TRUE);
sprintf(temp, "%s/etc/header.txt", getenv("MBSE_ROOT")); sprintf(temp, "%s/etc/header.txt", getenv("MBSE_ROOT"));
if(( pHeader = fopen(temp, "r")) != NULL) { if (( pHeader = fopen(temp, "r")) != NULL) {
Syslog('+', "Inserting %s", temp); Syslog('+', "Inserting %s", temp);
while( fgets(temp, 80 ,pHeader) != NULL) { while( fgets(temp, 80 ,pHeader) != NULL) {
@ -330,6 +330,7 @@ void Masterlist()
if (area.Available && (area.LTSec.level <= CFG.security.level)) { if (area.Available && (area.LTSec.level <= CFG.security.level)) {
Nopper();
sprintf(fAreas, "%s/fdb/fdb%d.data", getenv("MBSE_ROOT"), AreaNr); sprintf(fAreas, "%s/fdb/fdb%d.data", getenv("MBSE_ROOT"), AreaNr);
if ((pFile = fopen (fAreas, "r")) == NULL) { if ((pFile = fopen (fAreas, "r")) == NULL) {
@ -339,8 +340,7 @@ void Masterlist()
while (fread(&file, sizeof(file), 1, pFile) == 1) { while (fread(&file, sizeof(file), 1, pFile) == 1) {
if ((!file.Deleted) && (!file.Missing)) { if ((!file.Deleted) && (!file.Missing)) {
/* /*
* The next is to reduce system * The next is to reduce system load.
* loading.
*/ */
x++; x++;
if (CFG.slow_util && do_quiet && ((x % 3) == 0)) if (CFG.slow_util && do_quiet && ((x % 3) == 0))
@ -486,12 +486,14 @@ void MakeArc()
return; return;
} }
Nopper();
if (!do_quiet) if (!do_quiet)
printf("Creating allfiles.zip\n"); printf("Creating allfiles.zip\n");
if (!execute(cmd, (char *)"allfiles.zip allfiles.txt", (char *)NULL, (char *)"/dev/null", if (!execute(cmd, (char *)"allfiles.zip allfiles.txt", (char *)NULL, (char *)"/dev/null",
(char *)"/dev/null", (char *)"/dev/null") == 0) (char *)"/dev/null", (char *)"/dev/null") == 0)
WriteError("Create allfiles.zip failed"); WriteError("Create allfiles.zip failed");
Nopper();
if (!do_quiet) if (!do_quiet)
printf("Creating newfiles.zip\n"); printf("Creating newfiles.zip\n");
if (!execute(cmd, (char *)"newfiles.zip newfiles.txt", (char *)NULL, (char *)"/dev/null", if (!execute(cmd, (char *)"newfiles.zip newfiles.txt", (char *)NULL, (char *)"/dev/null",