Merge "BpfMap: override copy assignment operator"
This commit is contained in:
commit
406e92d02c
1 changed files with 5 additions and 0 deletions
|
|
@ -128,6 +128,11 @@ class BpfMap {
|
|||
|
||||
const base::unique_fd& getMap() const { return mMapFd; };
|
||||
|
||||
// Copy assignment operator
|
||||
void operator=(const BpfMap<Key, Value>& other) {
|
||||
mMapFd.reset(fcntl(other.mMapFd.get(), F_DUPFD_CLOEXEC, 0));
|
||||
}
|
||||
|
||||
// Move constructor
|
||||
void operator=(BpfMap<Key, Value>&& other) noexcept {
|
||||
mMapFd = std::move(other.mMapFd);
|
||||
|
|
|
|||
Loading…
Reference in a new issue