about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-12-12T16·14+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-12-12T16·14+0100
commitb77037b8fdd89cc06d80c3564e4a4f4a4fe8aa1d (patch)
tree013324b1b3e9e79f25163729abbbd2bb1a70801f /src/libstore/build.cc
parent46f3eb6fdd55394e90b1041e1af5089c0ca87091 (diff)
Silence some warnings on GCC 4.9
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 0153666c2b3a..08f44b392b00 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1976,9 +1976,11 @@ void DerivationGoal::runChild()
 
             /* Set the hostname etc. to fixed values. */
             char hostname[] = "localhost";
-            sethostname(hostname, sizeof(hostname));
+            if (sethostname(hostname, sizeof(hostname)) == -1)
+                throw SysError("cannot set host name");
             char domainname[] = "(none)"; // kernel default
-            setdomainname(domainname, sizeof(domainname));
+            if (setdomainname(domainname, sizeof(domainname)) == -1)
+                throw SysError("cannot set domain name");
 
             /* Make all filesystems private.  This is necessary
                because subtrees may have been mounted as "shared"