Prepared Add_BBS function for un_attach

This commit is contained in:
Michiel Broek 2004-07-16 20:07:46 +00:00
parent 0b04760570
commit 3506f477d5
2 changed files with 24 additions and 13 deletions

View File

@ -124,7 +124,7 @@ depend:
# DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT
# Dependencies generated by make depend # Dependencies generated by make depend
addbbs.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h tic.h fsort.h addbbs.h addbbs.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h tic.h fsort.h qualify.h addbbs.h
backalias.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h backalias.h backalias.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h backalias.h
flock.o: ../config.h ../lib/mbselib.h flock.h flock.o: ../config.h ../lib/mbselib.h flock.h
hatch.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h utic.h rollover.h hatch.h hatch.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h utic.h rollover.h hatch.h

View File

@ -34,6 +34,7 @@
#include "../lib/mbsedb.h" #include "../lib/mbsedb.h"
#include "tic.h" #include "tic.h"
#include "fsort.h" #include "fsort.h"
#include "qualify.h"
#include "addbbs.h" #include "addbbs.h"
@ -55,6 +56,7 @@ int Add_BBS()
char temp1[PATH_MAX], temp2[PATH_MAX], *fname, *lname, *p; char temp1[PATH_MAX], temp2[PATH_MAX], *fname, *lname, *p;
fd_list *fdl = NULL; fd_list *fdl = NULL;
struct _fdbarea *fdb_area = NULL; struct _fdbarea *fdb_area = NULL;
qualify *tmpq;
/* /*
* First check for an existing record with the same filename, * First check for an existing record with the same filename,
@ -273,12 +275,20 @@ int Add_BBS()
*/ */
if (DidDelete) { if (DidDelete) {
if ((fdb_area = mbsedb_OpenFDB(tic.FileArea, 30))) { if ((fdb_area = mbsedb_OpenFDB(tic.FileArea, 30))) {
while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
if (fdb.Deleted) { if (fdb.Deleted) {
sprintf(temp2, "%s/%s", area.Path, fdb.LName); sprintf(temp2, "%s/%s", area.Path, fdb.LName);
if (unlink(temp2) != 0) if (unlink(temp2) != 0)
WriteError("$Can't unlink file %s", temp2); WriteError("$Can't unlink file %s", temp2);
sprintf(temp2, "%s/%s", area.Path, fdb.Name); sprintf(temp2, "%s/%s", area.Path, fdb.Name);
/*
* With the path to the 8.3 name, we can check if this file
* is attached for any possible downlink.
* We must get the qualify list passed so we have a quick systems list.
*/
if (unlink(temp2) != 0) if (unlink(temp2) != 0)
WriteError("$Can't unlink file %s", temp2); WriteError("$Can't unlink file %s", temp2);
sprintf(temp2, "%s/.%s", area.Path, fdb.Name); sprintf(temp2, "%s/.%s", area.Path, fdb.Name);
@ -289,6 +299,7 @@ int Add_BBS()
DidDelete = FALSE; DidDelete = FALSE;
} }
} }
}
tic_imp++; tic_imp++;
return TRUE; return TRUE;