diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index 999b17cd2f..b19ff4bf99 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); }