about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/globals.cc8
-rw-r--r--src/libstore/globals.hh2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index e382b3aac03a..f900fb290bdb 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -143,6 +143,14 @@ bool Settings::get(const string & name, bool def)
 }
 
 
+int Settings::get(const string & name, int def)
+{
+    int res = def;
+    _get(res, name);
+    return res;
+}
+
+
 void Settings::update()
 {
     _get(tryFallback, "build-fallback");
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 0230a540e655..0a1072e36999 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -27,6 +27,8 @@ struct Settings {
 
     bool get(const string & name, bool def);
 
+    int get(const string & name, int def);
+
     void update();
 
     string pack();