1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 06:52:43 +01:00

* Some wrapper classes to ensure that file descriptors / directory

handles are closed when they go out of scope.
This commit is contained in:
Eelco Dolstra 2003-10-22 10:48:22 +00:00
parent c62433751d
commit 4a8948b7a6
6 changed files with 123 additions and 56 deletions

View file

@ -11,29 +11,6 @@
#include "globals.hh"
class AutoDelete
{
string path;
bool del;
public:
AutoDelete(const string & p) : path(p)
{
del = true;
}
~AutoDelete()
{
if (del) deletePath(path);
}
void cancel()
{
del = false;
}
};
static string pathNullDevice = "/dev/null";
@ -140,5 +117,3 @@ void runProgram(const string & program,
throw Error("unable to build package");
}
}