1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-22 17:01:08 +01:00

libutil: Also fix AutoUnmount special member functions

This commit is contained in:
Sergei Zimmerman 2025-12-15 01:22:18 +03:00
parent 54d2268d84
commit 198628790b
No known key found for this signature in database

View file

@ -480,8 +480,23 @@ class AutoUnmount
Path path; Path path;
bool del; bool del;
public: public:
AutoUnmount(Path &);
AutoUnmount(); AutoUnmount();
AutoUnmount(Path &);
AutoUnmount(const AutoUnmount &) = delete;
AutoUnmount(AutoUnmount && other) noexcept
: path(std::move(other.path))
, del(std::exchange(other.del, false))
{
}
AutoUnmount & operator=(AutoUnmount && other) noexcept
{
path = std::move(other.path);
del = std::exchange(other.del, false);
return *this;
}
~AutoUnmount(); ~AutoUnmount();
void cancel(); void cancel();
}; };