X-Git-Url: http://dolda2000.com/gitweb/?p=statserve.git;a=blobdiff_plain;f=dbsrc.c;fp=dbsrc.c;h=bb239ae5f57b85599d4baabd7f27dfdd3e15c563;hp=fa9899cca5378eeb9c95279251eb48727985dd23;hb=ea4e0b7174a8372eaa3b9519e7ca98e6ba78c6d7;hpb=34d725a595138f81ba84d67d7b84766c3a270d9f diff --git a/dbsrc.c b/dbsrc.c index fa9899c..bb239ae 100644 --- a/dbsrc.c +++ b/dbsrc.c @@ -15,6 +15,8 @@ struct dbsrc { time_t lastcp, lastar; }; +int dbpagesize = 0; + static struct fileinfo dbserve(struct source *src, char *nm) { struct dbsrc *d = src->pdata; @@ -142,6 +144,12 @@ struct source *mkdbsrc(char *path, char *envpath) flog(LOG_ERR, "could not create bdb database: %s", db_strerror(ret)); exit(1); } + if(dbpagesize) { + if((ret = d->db->set_pagesize(d->db, dbpagesize)) != 0) { + flog(LOG_ERR, "could not set bdb page size (to %i): %s", dbpagesize, db_strerror(ret)); + exit(1); + } + } if((ret = d->db->open(d->db, NULL, path, NULL, DB_HASH, DB_AUTO_COMMIT | DB_CREATE, 0666)) != 0) { flog(LOG_ERR, "could not open bdb database: %s", db_strerror(ret)); exit(1);