From 40d9eb14dfb842c51e9f86818b43ae7711e1a5d6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 22 Nov 2003 15:58:34 +0000 Subject: * Fix the garbage collector. --- src/libstore/store.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/store.cc b/src/libstore/store.cc index c83316cf6..caaa293a6 100644 --- a/src/libstore/store.cc +++ b/src/libstore/store.cc @@ -1,9 +1,6 @@ #include -#include -#include #include -#include #include #include "store.hh" @@ -307,11 +304,7 @@ void addTextToStore(const Path & dstPath, const string & s) PathLocks outputLock(lockPaths); if (!isValidPath(dstPath)) { - - AutoCloseFD fd = open(dstPath.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0666); - if (fd == -1) throw SysError(format("creating store file `%1%'") % dstPath); - - writeFull(fd, (unsigned char *) s.c_str(), s.size()); + writeStringToFile(dstPath, s); Transaction txn(nixDB); registerValidPath(txn, dstPath); -- cgit v1.2.3