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
|
@ -6,6 +6,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "util.hh"
|
||||
|
||||
|
@ -192,6 +193,16 @@ Path createTempDir()
|
|||
}
|
||||
|
||||
|
||||
void writeStringToFile(const Path & path, const string & s)
|
||||
{
|
||||
AutoCloseFD fd = open(path.c_str(),
|
||||
O_CREAT | O_EXCL | O_WRONLY, 0666);
|
||||
if (fd == -1)
|
||||
throw SysError(format("creating file `%1%'") % path);
|
||||
writeFull(fd, (unsigned char *) s.c_str(), s.size());
|
||||
}
|
||||
|
||||
|
||||
Verbosity verbosity = lvlError;
|
||||
|
||||
static int nestingLevel = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue