aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-06-28 00:05:21 -0700
committerjade <lix@jade.fyi>2024-07-19 20:55:55 +0000
commit77ff799cc8214db4db8f848c56bdc8c502a0fdb7 (patch)
tree3568d3411fc56d5fb6ffc4765a03b2088b666074 /src/libstore/local-store.cc
parent22252825c4ea5e8a60eea419ebe352cab184e8b6 (diff)
gc: refactor the gc server thread out into a class without changing it
This removes a *whole load* of variables from scope and enforces thread boundaries with the type system. There is not much change of significance in here, so the things to watch out for while reviewing it are primarily that the destructor ordering may have changed inadvertently, I think. Change-Id: I3cd87e6d5a08dfcf368637407251db22a8906316
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 757aa21e3..10d43ee3e 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -181,7 +181,7 @@ LocalStore::LocalStore(const Params & params)
, LocalFSStore(params)
, dbDir(stateDir + "/db")
, linksDir(realStoreDir + "/.links")
- , reservedPath(dbDir + "/reserved")
+ , reservedSpacePath(dbDir + "/reserved")
, schemaPath(dbDir + "/schema")
, tempRootsDir(stateDir + "/temproots")
, fnTempRoots(fmt("%s/%d", tempRootsDir, getpid()))
@@ -259,10 +259,10 @@ LocalStore::LocalStore(const Params & params)
before doing a garbage collection. */
try {
struct stat st;
- if (stat(reservedPath.c_str(), &st) == -1 ||
+ if (stat(reservedSpacePath.c_str(), &st) == -1 ||
st.st_size != settings.reservedSize)
{
- AutoCloseFD fd{open(reservedPath.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC, 0600)};
+ AutoCloseFD fd{open(reservedSpacePath.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC, 0600)};
int res = -1;
#if HAVE_POSIX_FALLOCATE
res = posix_fallocate(fd.get(), 0, settings.reservedSize);