Patch config and hpfs sync refactor. (#208)

* Terminology changes from state to hpfs.
* Syncing hpfs parents in priority order.
* Changing how the hash is calculate in hpfs response validate check.
This commit is contained in:
Savinda Senevirathne
2021-01-06 10:50:58 +05:30
committed by GitHub
parent a16eb39d1f
commit c87ae6693d
31 changed files with 790 additions and 688 deletions

View File

@@ -355,6 +355,15 @@ namespace util
return 0;
}
// Returns the file/dir name of the given path.
const std::string get_name(std::string_view path)
{
char *path2 = strdup(path.data());
const std::string name = basename(path2);
free(path2);
return name;
}
/**
* Create a record lock for the file descriptor. Lock is associated with the process (Not for forked child processes).
* @param fd File descriptor to be locked.