about summary refs log tree commit diff
path: root/src/build-remote
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-01-25T11·51+0100
committerEelco Dolstra <edolstra@gmail.com>2017-01-26T19·40+0100
commita55f589720e6499ed8ca1e3dd63ae18c52782150 (patch)
tree9bcc366d7ea1030a38d248e44efd5fb99bd8408d /src/build-remote
parentc0f2f4eeeffd9c62ee2c59b42e6824d297d210f1 (diff)
openLockFile: Return an AutoCloseFD
Diffstat (limited to 'src/build-remote')
-rw-r--r--src/build-remote/build-remote.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index 1daf0b80ba70..acbd308f84e1 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -109,7 +109,7 @@ static std::vector<machine> read_conf()
 
 static string currentLoad;
 
-static int openSlotLock(const machine & m, unsigned long long slot)
+static AutoCloseFD openSlotLock(const machine & m, unsigned long long slot)
 {
     std::ostringstream fn_stream(currentLoad, std::ios_base::ate | std::ios_base::out);
     fn_stream << "/";
@@ -187,7 +187,7 @@ int main (int argc, char * * argv)
                         AutoCloseFD free;
                         unsigned long long load = 0;
                         for (unsigned long long slot = 0; slot < m.maxJobs; ++slot) {
-                            AutoCloseFD slotLock = openSlotLock(m, slot);
+                            auto slotLock = openSlotLock(m, slot);
                             if (lockFile(slotLock.get(), ltWrite, false)) {
                                 if (!free) {
                                     free = std::move(slotLock);