MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / LockDirectory

Function LockDirectory

src/init.cpp:1176–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1174}
1175
1176static bool LockDirectory(const fs::path& dir, bool probeOnly)
1177{
1178 // Make sure only a single process is using the directory.
1179 switch (util::LockDirectory(dir, ".lock", probeOnly)) {
1180 case util::LockResult::ErrorWrite:
1181 return InitError(strprintf(_("Cannot write to directory '%s'; check permissions."), fs::PathToString(dir)));
1182 case util::LockResult::ErrorLock:
1183 return InitError(strprintf(_("Cannot obtain a lock on directory %s. %s is probably already running."), fs::PathToString(dir), CLIENT_NAME));
1184 case util::LockResult::Success: return true;
1185 } // no default case, so the compiler can warn about missing cases
1186 assert(false);
1187}
1188static bool LockDirectories(bool probeOnly)
1189{
1190 return LockDirectory(gArgs.GetDataDirNet(), probeOnly) && \

Callers 1

LockDirectoriesFunction · 0.70

Calls 3

InitErrorFunction · 0.85
_Function · 0.85
PathToStringFunction · 0.85

Tested by

no test coverage detected