- struct tdb1_context *i;
-
- for (i = tdb1s; i; i = i->next) {
- if (i->device == device && i->inode == ino) {
- return 1;
- }
- }
-
- return 0;
-}
-
-/* open the database, creating it if necessary
-
- The open_flags and mode are passed straight to the open call on the
- database file. A flags value of O_WRONLY is invalid. The hash size
- is advisory, use zero for a default value.
-
- Return is NULL on error, in which case errno is also set. Don't
- try to call tdb1_error or tdb1_errname, just do strerror(errno).
-
- @param name may be NULL for internal databases. */
-struct tdb1_context *tdb1_open(const char *name, int hash_size, int tdb1_flags,
- int open_flags, mode_t mode)
-{
- return tdb1_open_ex(name, hash_size, tdb1_flags, open_flags, mode, NULL, NULL);
+ tdb1_header_hash(tdb, m1, m2);
+ return (tdb->tdb1.header.magic1_hash == *m1 &&
+ tdb->tdb1.header.magic2_hash == *m2);