Completed mbtask new disk watcher
This commit is contained in:
@@ -143,8 +143,10 @@ int main(int argc, char **argv)
|
||||
if (!do_quiet)
|
||||
printf("\n");
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (lockprogram((char *)"mbaff")) {
|
||||
if (!do_quiet)
|
||||
|
@@ -167,8 +167,10 @@ int main(int argc, char **argv)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract work directory from the first commandline parameter
|
||||
|
@@ -424,8 +424,10 @@ int main(int argc, char **argv)
|
||||
/*
|
||||
* Not yet locked, if anything goes wrong, exit with die(MBERR_NO_PROGLOCK)
|
||||
*/
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (do_mail) {
|
||||
/*
|
||||
@@ -671,7 +673,8 @@ int TossMail(void)
|
||||
Syslog('+', "Detected upsalarm semafore, aborting toss");
|
||||
break;
|
||||
}
|
||||
if (!diskfree(CFG.freespace)) {
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, aborting toss");
|
||||
rc = MBERR_DISK_FULL;
|
||||
break;
|
||||
}
|
||||
@@ -742,8 +745,10 @@ int TossPkts(void)
|
||||
*/
|
||||
while ((fname = pull_fdlist(&fdl)) != NULL) {
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort tossing packet");
|
||||
return FALSE;
|
||||
}
|
||||
packets++;
|
||||
|
||||
/*
|
||||
|
@@ -234,8 +234,10 @@ int main(int argc, char **argv)
|
||||
if (!do_quiet)
|
||||
printf("\n");
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (lockprogram((char *)"mbfile")) {
|
||||
if (!do_quiet)
|
||||
|
@@ -173,8 +173,10 @@ void ImportFiles(int Area)
|
||||
/*
|
||||
* Check diskspace
|
||||
*/
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
Files++;
|
||||
memset(&f_db, 0, sizeof(f_db));
|
||||
|
@@ -358,8 +358,10 @@ void ReqIndex(void)
|
||||
|
||||
if (area.Available) {
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (!do_quiet) {
|
||||
printf("\r%4ld => %-44s \b\b\b\b", i, area.Name);
|
||||
@@ -597,8 +599,10 @@ void HtmlIndex(char *Lang)
|
||||
|
||||
if (area.Available) {
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (!do_quiet) {
|
||||
printf("\r%4ld => %-44s \b\b\b\b", i, area.Name);
|
||||
|
@@ -86,8 +86,10 @@ void Kill(void)
|
||||
|
||||
if ((area.Available) && (area.DLdays || area.FDdays) && (!area.CDrom)) {
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (!do_quiet) {
|
||||
printf("\r%4d => %-44s \b\b\b\b", i, area.Name);
|
||||
|
@@ -79,8 +79,10 @@ void PackFileBase(void)
|
||||
|
||||
if (area.Available && !area.CDrom) {
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (!do_quiet) {
|
||||
printf("\r%4d => %-44s", i, area.Name);
|
||||
|
@@ -158,8 +158,10 @@ void SortFileBase(int Area)
|
||||
|
||||
if (area.Available) {
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (!do_quiet) {
|
||||
printf("Sorting area %d: %-44s", Area, area.Name);
|
||||
|
@@ -177,8 +177,10 @@ int main(int argc,char *argv[])
|
||||
Syslog(' ', cmd);
|
||||
free(cmd);
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (lockprogram((char *)"mbindex")) {
|
||||
if (!do_quiet)
|
||||
|
@@ -277,8 +277,10 @@ void DoMsgBase()
|
||||
fread(&msgs, msgshdr.recsize, 1, pAreas);
|
||||
if (msgs.Active) {
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
if (!do_quiet) {
|
||||
colour(3, 0);
|
||||
@@ -306,8 +308,10 @@ void DoMsgBase()
|
||||
arearec++;
|
||||
if (msgs.Active) {
|
||||
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort");
|
||||
die(MBERR_DISK_FULL);
|
||||
}
|
||||
|
||||
Nopper();
|
||||
if (!do_quiet) {
|
||||
|
@@ -610,8 +610,10 @@ void flush_queue(void)
|
||||
DIR *dp;
|
||||
|
||||
Syslog('+', "Flushing outbound queue");
|
||||
if (!diskfree(CFG.freespace))
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, not flushing outbound queue");
|
||||
return;
|
||||
}
|
||||
|
||||
IsDoing("Flush queue");
|
||||
if (!do_quiet) {
|
||||
|
@@ -76,7 +76,8 @@ int Tic()
|
||||
}
|
||||
Syslog('+', "Pass: process ticfiles (%s)", inbound);
|
||||
|
||||
if (!diskfree(CFG.freespace)) {
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, abort tic processing");
|
||||
free(inbound);
|
||||
return -1;
|
||||
}
|
||||
@@ -128,7 +129,8 @@ int Tic()
|
||||
Syslog('+', "Detected upsalarm semafore, aborting tic processing");
|
||||
break;
|
||||
}
|
||||
if (!diskfree(CFG.freespace)) {
|
||||
if (enoughspace(CFG.freespace) == 0) {
|
||||
Syslog('+', "Low diskspace, aborting tic processing");
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user