mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
* Fix the garbage collector.
This commit is contained in:
parent
7a02d95418
commit
40d9eb14df
5 changed files with 38 additions and 12 deletions
|
@ -1,9 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue