about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-04-23T14·59+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-04-23T14·59+0200
commit934cf2d1f4c46ecd6afd30cfb14aa55a6bf3d790 (patch)
tree59eac0bc261611c5b24a477a003e1432fc987fed /src
parent08d96ffad094f4b686a2ad8f2a41a6b046b0f81b (diff)
Nix daemon: respect build timeout from the client
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc2
-rw-r--r--src/nix-daemon/nix-daemon.cc7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 137056810925..5be2b1481e48 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -3231,7 +3231,7 @@ void Worker::waitForInput()
             after - before >= (time_t) settings.buildTimeout)
         {
             printMsg(lvlError,
-                format("%1% timed out after %2% seconds of activity")
+                format("%1% timed out after %2% seconds")
                 % goal->getName() % settings.buildTimeout);
             goal->cancel();
         }
diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc
index 9c6766557dde..a3ab1d068bd7 100644
--- a/src/nix-daemon/nix-daemon.cc
+++ b/src/nix-daemon/nix-daemon.cc
@@ -551,7 +551,10 @@ static void performOp(unsigned int clientVersion,
             for (unsigned int i = 0; i < n; i++) {
                 string name = readString(from);
                 string value = readString(from);
-                settings.set("untrusted-" + name, value);
+                if (name == "build-timeout")
+                    string2Int(value, settings.buildTimeout);
+                else
+                    settings.set("untrusted-" + name, value);
             }
         }
         startWork();
@@ -895,8 +898,6 @@ static void daemonLoop()
 
 void run(Strings args)
 {
-    bool daemon = false;
-
     for (Strings::iterator i = args.begin(); i != args.end(); ) {
         string arg = *i++;
         if (arg == "--daemon") /* ignored for backwards compatibility */;