3 * Copyright (C) Joerg Lenneis 2003
4 * All Rights Reserved. See COPYING.
9 #endif /* HAVE_CONFIG_H */
13 #include <sys/param.h>
15 #include <arpa/inet.h>
17 #include <atalk/logger.h>
18 #include <atalk/cnid_bdb_private.h>
24 int dbd_check_indexes(DBD *dbd, char *dbdir)
26 u_int32_t c_didname = 0, c_devino = 0, c_cnid = 0;
28 LOG(log_note, logtype_cnid, "CNID database at `%s' is being checked (quick)", dbdir);
30 if (dbif_count(dbd, DBIF_CNID, &c_cnid))
33 if (dbif_count(dbd, DBIF_IDX_DEVINO, &c_devino))
36 /* bailout after the first error */
37 if ( c_cnid != c_devino) {
38 LOG(log_error, logtype_cnid, "CNID database at `%s' corrupted (%u/%u)", dbdir, c_cnid, c_devino);
42 if (dbif_count(dbd, DBIF_IDX_DIDNAME, &c_didname))
45 if ( c_cnid != c_didname) {
46 LOG(log_error, logtype_cnid, "CNID database at `%s' corrupted (%u/%u)", dbdir, c_cnid, c_didname);
50 LOG(log_note, logtype_cnid, "CNID database at `%s' seems ok, %u entries.", dbdir, c_cnid);