From: Richard Kettlewell Date: Sat, 19 Jan 2008 12:08:12 +0000 (+0000) Subject: Report an error if we cannot open the user database. X-Git-Tag: 3.0~43 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/0934814d5bd217ce663d32e95d4e044a6eefca7b Report an error if we cannot open the user database. The likely case here is that the server has not been started yet and we are still trying to run the client for some reason. --- diff --git a/lib/trackdb.c b/lib/trackdb.c index 5c64978..3f4aee9 100644 --- a/lib/trackdb.c +++ b/lib/trackdb.c @@ -441,6 +441,9 @@ void trackdb_open(int flags) { trackdb_existing_database = 0; } /* open the databases */ + if(!(trackdb_usersdb = open_db("users.db", + 0, DB_HASH, dbflags, 0600))) + fatal(0, "cannot open users.db"); trackdb_tracksdb = open_db("tracks.db", DB_RECNUM, DB_BTREE, dbflags, 0666); trackdb_searchdb = open_db("search.db", @@ -451,8 +454,6 @@ void trackdb_open(int flags) { trackdb_globaldb = open_db("global.db", 0, DB_HASH, dbflags, 0666); trackdb_noticeddb = open_db("noticed.db", DB_DUPSORT, DB_BTREE, dbflags, 0666); - trackdb_usersdb = open_db("users.db", - 0, DB_HASH, dbflags, 0600); if(!trackdb_existing_database) { /* Stash the database version */ char buf[32];