Removed debug logging
This commit is contained in:
parent
4c0908b0e5
commit
6f03858520
@ -18,6 +18,9 @@ v0.61.1 20-Jun-2004.
|
|||||||
If a message area becomes empty after a pack, all lastread
|
If a message area becomes empty after a pack, all lastread
|
||||||
pointers are reset to zero.
|
pointers are reset to zero.
|
||||||
|
|
||||||
|
libdbsae.a:
|
||||||
|
Removed some debug logging from files database module.
|
||||||
|
|
||||||
mbout:
|
mbout:
|
||||||
Code cleanup for nodelist processing.
|
Code cleanup for nodelist processing.
|
||||||
|
|
||||||
|
37
lib/dbfdb.c
37
lib/dbfdb.c
@ -47,8 +47,6 @@ struct _fdbarea *mbsedb_OpenFDB(long Area, int Timeout)
|
|||||||
int Tries = 0;
|
int Tries = 0;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
Syslog('f', "OpenFDB area %ld, timeout %d", Area, Timeout);
|
|
||||||
|
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
fdb_area = malloc(sizeof(struct _fdbarea)); /* Will be freed by CloseFDB */
|
fdb_area = malloc(sizeof(struct _fdbarea)); /* Will be freed by CloseFDB */
|
||||||
|
|
||||||
@ -124,15 +122,7 @@ struct _fdbarea *mbsedb_OpenFDB(long Area, int Timeout)
|
|||||||
*/
|
*/
|
||||||
int mbsedb_CloseFDB(struct _fdbarea *fdb_area)
|
int mbsedb_CloseFDB(struct _fdbarea *fdb_area)
|
||||||
{
|
{
|
||||||
Syslog('f', "CloseFDB %ld", fdb_area->area);
|
|
||||||
if (fdb_area->locked) {
|
|
||||||
/*
|
|
||||||
* Unlock first
|
|
||||||
*/
|
|
||||||
// mbsedb_UnlockFDB(fdb_area);
|
|
||||||
}
|
|
||||||
fclose(fdb_area->fp);
|
fclose(fdb_area->fp);
|
||||||
|
|
||||||
free(fdb_area);
|
free(fdb_area);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -147,7 +137,6 @@ int mbsedb_LockFDB(struct _fdbarea *fdb_area, int Timeout)
|
|||||||
int rc, Tries = 0;
|
int rc, Tries = 0;
|
||||||
struct flock fl;
|
struct flock fl;
|
||||||
|
|
||||||
Syslog('f', "LockFDB %ld", fdb_area->area);
|
|
||||||
fl.l_type = F_WRLCK;
|
fl.l_type = F_WRLCK;
|
||||||
fl.l_whence = SEEK_SET;
|
fl.l_whence = SEEK_SET;
|
||||||
fl.l_start = 0L;
|
fl.l_start = 0L;
|
||||||
@ -182,7 +171,6 @@ int mbsedb_UnlockFDB(struct _fdbarea *fdb_area)
|
|||||||
{
|
{
|
||||||
struct flock fl;
|
struct flock fl;
|
||||||
|
|
||||||
Syslog('f', "UnlockFDB %ld", fdb_area->area);
|
|
||||||
fl.l_type = F_UNLCK;
|
fl.l_type = F_UNLCK;
|
||||||
fl.l_whence = SEEK_SET;
|
fl.l_whence = SEEK_SET;
|
||||||
fl.l_start = 0L;
|
fl.l_start = 0L;
|
||||||
@ -352,13 +340,12 @@ int mbsedb_PackFDB(struct _fdbarea *fdb_area)
|
|||||||
{
|
{
|
||||||
char *temp, *temp2;
|
char *temp, *temp2;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int rc, count = 0;
|
int count = 0;
|
||||||
|
|
||||||
Syslog('f', "PackFDB %ld", fdb_area->area);
|
Syslog('f', "PackFDB %ld", fdb_area->area);
|
||||||
|
|
||||||
fseek(fdb_area->fp, 0, SEEK_END);
|
fseek(fdb_area->fp, 0, SEEK_END);
|
||||||
if (ftell(fdb_area->fp) == fdbhdr.hdrsize) {
|
if (ftell(fdb_area->fp) == fdbhdr.hdrsize) {
|
||||||
Syslog('f', "no records, nothing to do");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,14 +380,11 @@ int mbsedb_PackFDB(struct _fdbarea *fdb_area)
|
|||||||
*/
|
*/
|
||||||
sprintf(temp2, "%s/fdb/file%ld.data", getenv("MBSE_ROOT"), fdb_area->area);
|
sprintf(temp2, "%s/fdb/file%ld.data", getenv("MBSE_ROOT"), fdb_area->area);
|
||||||
sprintf(temp, "%s/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area->area);
|
sprintf(temp, "%s/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area->area);
|
||||||
rc = rename(temp2, temp);
|
rename(temp2, temp);
|
||||||
Syslog('f', "rename %s %s rc=%d", temp2, temp, rc);
|
|
||||||
sprintf(temp, "%s/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area);
|
sprintf(temp, "%s/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area);
|
||||||
rc = rename(temp, temp2);
|
rename(temp, temp2);
|
||||||
Syslog('f', "rename %s %s rc=%d", temp, temp2, rc);
|
|
||||||
sprintf(temp, "%s/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area->area);
|
sprintf(temp, "%s/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area->area);
|
||||||
rc = unlink(temp);
|
unlink(temp);
|
||||||
Syslog('f', "unlink %s rc=%d", temp, rc);
|
|
||||||
|
|
||||||
fdb_area->fp = fp;
|
fdb_area->fp = fp;
|
||||||
fdb_area->locked = 0;
|
fdb_area->locked = 0;
|
||||||
@ -498,7 +482,7 @@ int mbsedb_SortFDB(struct _fdbarea *fdb_area)
|
|||||||
fdbs *fdx = NULL, *tmp;
|
fdbs *fdx = NULL, *tmp;
|
||||||
char *temp, *temp2;
|
char *temp, *temp2;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int count = 0, rc;
|
int count = 0;
|
||||||
|
|
||||||
Syslog('f', "SortFDB %ld", fdb_area->area);
|
Syslog('f', "SortFDB %ld", fdb_area->area);
|
||||||
|
|
||||||
@ -512,7 +496,6 @@ int mbsedb_SortFDB(struct _fdbarea *fdb_area)
|
|||||||
|
|
||||||
while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
|
while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
|
||||||
fill_fdbs(fdb, &fdx);
|
fill_fdbs(fdb, &fdx);
|
||||||
Syslog('f', "Adding %s", fdb.LName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sort_fdbs(&fdx);
|
sort_fdbs(&fdx);
|
||||||
@ -541,7 +524,6 @@ int mbsedb_SortFDB(struct _fdbarea *fdb_area)
|
|||||||
* Write sorted files to temp database
|
* Write sorted files to temp database
|
||||||
*/
|
*/
|
||||||
for (tmp = fdx; tmp; tmp = tmp->next) {
|
for (tmp = fdx; tmp; tmp = tmp->next) {
|
||||||
Syslog('f', "Sorted %s", tmp->filrec.LName);
|
|
||||||
fwrite(&tmp->filrec, fdbhdr.recsize, 1, fp);
|
fwrite(&tmp->filrec, fdbhdr.recsize, 1, fp);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -555,14 +537,11 @@ int mbsedb_SortFDB(struct _fdbarea *fdb_area)
|
|||||||
temp2 = calloc(PATH_MAX, sizeof(char));
|
temp2 = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp2, "%s/fdb/file%ld.data", getenv("MBSE_ROOT"), fdb_area->area);
|
sprintf(temp2, "%s/fdb/file%ld.data", getenv("MBSE_ROOT"), fdb_area->area);
|
||||||
sprintf(temp, "%s/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area->area);
|
sprintf(temp, "%s/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area->area);
|
||||||
rc = rename(temp2, temp);
|
rename(temp2, temp);
|
||||||
Syslog('f', "rename %s %s rc=%d", temp2, temp, rc);
|
|
||||||
sprintf(temp, "%s/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area);
|
sprintf(temp, "%s/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area);
|
||||||
rc = rename(temp, temp2);
|
rename(temp, temp2);
|
||||||
Syslog('f', "rename %s %s rc=%d", temp, temp2, rc);
|
|
||||||
sprintf(temp, "%s/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area->area);
|
sprintf(temp, "%s/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area->area);
|
||||||
rc = unlink(temp);
|
unlink(temp);
|
||||||
Syslog('f', "unlink %s rc=%d", temp, rc);
|
|
||||||
|
|
||||||
fdb_area->fp = fp;
|
fdb_area->fp = fp;
|
||||||
fdb_area->locked = 0;
|
fdb_area->locked = 0;
|
||||||
|
Reference in New Issue
Block a user