mirror of
https://github.com/NixOS/nix.git
synced 2025-12-22 17:01:08 +01:00
libutil: Fix AutoRemoveJail special member functions
These can't be copied and moving requires special logic too.
This commit is contained in:
parent
3a62be7227
commit
8c74aadbf7
1 changed files with 18 additions and 0 deletions
|
|
@ -11,6 +11,24 @@ class AutoRemoveJail
|
||||||
bool del;
|
bool del;
|
||||||
public:
|
public:
|
||||||
AutoRemoveJail(int jid);
|
AutoRemoveJail(int jid);
|
||||||
|
AutoRemoveJail(const AutoRemoveJail &) = delete;
|
||||||
|
AutoRemoveJail & operator=(const AutoRemoveJail &) = delete;
|
||||||
|
|
||||||
|
AutoRemoveJail(AutoRemoveJail && other) noexcept
|
||||||
|
: jid(other.jid)
|
||||||
|
, del(other.del)
|
||||||
|
{
|
||||||
|
other.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
AutoRemoveJail & operator=(AutoRemoveJail && other) noexcept
|
||||||
|
{
|
||||||
|
jid = other.jid;
|
||||||
|
del = other.del;
|
||||||
|
other.cancel();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
AutoRemoveJail();
|
AutoRemoveJail();
|
||||||
~AutoRemoveJail();
|
~AutoRemoveJail();
|
||||||
void cancel();
|
void cancel();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue