1
1
Fork 0
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:
Sergei Zimmerman 2025-12-15 00:33:24 +03:00
parent 3a62be7227
commit 8c74aadbf7
No known key found for this signature in database

View file

@ -11,6 +11,24 @@ class AutoRemoveJail
bool del;
public:
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();
void cancel();