about summary refs log tree commit diff
path: root/src/libstore/store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-02-16T13·58+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-02-16T13·58+0000
commit345a95afe9e265bc433eea46c32c507ea84a72a4 (patch)
tree742bf5e45e2eeaf00673fe30fe13726531733b56 /src/libstore/store.cc
parent651ab439cf5b0c6ab2044257a30b0d94406d57d3 (diff)
* Allow the size of the GC reserved file to be specified in nix.conf
  through the new `gc-reserved-space' option.

Diffstat (limited to 'src/libstore/store.cc')
-rw-r--r--src/libstore/store.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/store.cc b/src/libstore/store.cc
index 25e2d6e36009..94c992f22936 100644
--- a/src/libstore/store.cc
+++ b/src/libstore/store.cc
@@ -82,12 +82,14 @@ void openDB(bool reserveSpace)
 
     try {
         Path reservedPath = nixDBPath + "/reserved";
-        off_t reservedSize = 1024 * 1024;
+        string s = querySetting("gc-reserved-space", "");
+        int reservedSize;
+        if (!string2Int(s, reservedSize)) reservedSize = 1024 * 1024;
         if (reserveSpace) {
             struct stat st;
             if (stat(reservedPath.c_str(), &st) == -1 ||
                 st.st_size != reservedSize)
-                writeFile(reservedPath, string(1024 * 1024, 'X'));
+                writeFile(reservedPath, string(reservedSize, 'X'));
         }
         else
             deletePath(reservedPath);