about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-09-17T12·06+0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-09-17T12·06+0000
commitf53574ebd60e5a22dbaae7e2bec97f5993670c20 (patch)
tree995740de8d6594d4e82612979f5f40b65fe35a0b
parentd5529f5b85d4f093c6c051c060eb6feef9f8f76f (diff)
RestoreSink: Slightly reduce the number of concurrent FDs
-rw-r--r--src/libutil/archive.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index 999b17cd2f19..b19ff4bf99a1 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -282,6 +282,7 @@ struct RestoreSink : ParseSink
     void createRegularFile(const Path & path)
     {
         Path p = dstPath + path;
+        fd.close();
         fd = open(p.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0666);
         if (fd == -1) throw SysError(format("creating file `%1%'") % p);
     }