MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / notifyDatabaseName

Function notifyDatabaseName

src/common/db_alias.cpp:563–587  ·  view source on GitHub ↗

Probably file arrived on the disk

Source from the content-addressed store, hash-verified

561
562// Probably file arrived on the disk
563bool notifyDatabaseName(const Firebird::PathName& file)
564{
565#ifdef HAVE_ID_BY_NAME
566 // notifyDatabaseName typically causes changes in aliasesConf()
567 // cause it's called only from Config created for missing database.
568 // Therefore always take write lock at once.
569 WriteLockGuard guard(aliasesConf().rwLock, "notifyDatabaseName");
570
571 DbName* db = aliasesConf().dbHash.lookup(file);
572 if (!db)
573 return true;
574 if (db->id)
575 return true;
576
577 UCharBuffer id;
578 os_utils::getUniqueFileId(file.c_str(), id);
579 if (id.hasData())
580 {
581 aliasesConf().linkId(db, id);
582 return true;
583 }
584#endif
585
586 return false;
587}

Callers 1

notifyMethod · 0.85

Calls 5

linkIdMethod · 0.80
getUniqueFileIdFunction · 0.50
lookupMethod · 0.45
c_strMethod · 0.45
hasDataMethod · 0.45

Tested by

no test coverage detected