Probably file arrived on the disk
| 561 | |
| 562 | // Probably file arrived on the disk |
| 563 | bool 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 | } |