chiark / gitweb /
Report an error if we cannot open the user database.
authorRichard Kettlewell <richard@deodand>
Sat, 19 Jan 2008 12:08:12 +0000 (12:08 +0000)
committerRichard Kettlewell <richard@deodand>
Sat, 19 Jan 2008 12:08:12 +0000 (12:08 +0000)
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.

lib/trackdb.c

index 5c64978..3f4aee9 100644 (file)
@@ -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];