#define DATABASEDIR "/var/lib/vnstat"
#endif
#endif
+#define DATABASEFILE "vnstat.db"
/* on which day should months change */
#define MONTHROTATE 1
/* check if there's something to work with */
s->dbcount = 0;
while ((di=readdir(dir))) {
- if (di->d_name[0]!='.') {
+ if ((di->d_name[0]!='.') && (strcmp(di->d_name, DATABASEFILE)!=0)) {
s->dbcount++;
}
}
}
while ((di=readdir(dir))) {
- if (di->d_name[0]=='.') {
+ if ((di->d_name[0]=='.') || (strcmp(di->d_name, DATABASEFILE)==0)) {
continue;
}
if (debug)
printf("Dir OK\n");
while ((di=readdir(dir))) {
- if (di->d_name[0]=='.') {
+ if ((di->d_name[0]=='.') || (strcmp(di->d_name, DATABASEFILE)==0)) {
continue;
}
strncpy_nt(p.definterface, di->d_name, 32);
while ((di=readdir(dir))) {
/* ignore backup files, '.' and '..' dirs */
- if (di->d_name[0]=='.') {
+ if ((di->d_name[0]=='.') || (strcmp(di->d_name, DATABASEFILE)==0)) {
continue;
}
return;
}
while ((di=readdir(dir))) {
- if (di->d_name[0]=='.') {
+ if ((di->d_name[0]=='.') || (strcmp(di->d_name, DATABASEFILE)==0)) {
continue;
}
strncpy_nt(p->interface, di->d_name, 32);