mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
2248a3f545
This keeps the call sites simple, eventually this should be filled in.
41 lines
532 B
C++
41 lines
532 B
C++
#include "pathlocks.hh"
|
|
#include "util.hh"
|
|
#include "sync.hh"
|
|
#include "signals.hh"
|
|
|
|
#include <cerrno>
|
|
#include <cstdlib>
|
|
|
|
|
|
namespace nix {
|
|
|
|
PathLocks::PathLocks()
|
|
: deletePaths(false)
|
|
{
|
|
}
|
|
|
|
|
|
PathLocks::PathLocks(const PathSet & paths, const std::string & waitMsg)
|
|
: deletePaths(false)
|
|
{
|
|
lockPaths(paths, waitMsg);
|
|
}
|
|
|
|
|
|
PathLocks::~PathLocks()
|
|
{
|
|
try {
|
|
unlock();
|
|
} catch (...) {
|
|
ignoreException();
|
|
}
|
|
}
|
|
|
|
|
|
void PathLocks::setDeletion(bool deletePaths)
|
|
{
|
|
this->deletePaths = deletePaths;
|
|
}
|
|
|
|
|
|
}
|