diff options
author | Maciej Żenczykowski <maze@google.com> | 2020-04-24 17:36:51 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-04-24 17:36:51 +0000 |
commit | c0ccdf30c058433400d0ffe656254270a821bc9c (patch) | |
tree | 206a9ee3254ca45160b6db68fb6ac12cd10391bb | |
parent | e4770b88c3ca0d23f79ae441de5572940fa88fc4 (diff) | |
parent | a0ada3347612356967f9e3cbd4089987bc756739 (diff) | |
download | bpf-c0ccdf30c058433400d0ffe656254270a821bc9c.tar.gz |
BpfMap.h - fix cert-oop54-cpp compiler warning am: eaa7b9eb3f am: a0ada33476
Change-Id: I041b123ee0eaba4b389e4d72b8f3b9eb33e9e3f3
-rw-r--r-- | libbpf_android/include/bpf/BpfMap.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbpf_android/include/bpf/BpfMap.h b/libbpf_android/include/bpf/BpfMap.h index 8c35931..c92f989 100644 --- a/libbpf_android/include/bpf/BpfMap.h +++ b/libbpf_android/include/bpf/BpfMap.h @@ -129,8 +129,9 @@ 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)); + BpfMap<Key, Value>& operator=(const BpfMap<Key, Value>& other) { + if (this != &other) mMapFd.reset(fcntl(other.mMapFd.get(), F_DUPFD_CLOEXEC, 0)); + return *this; } // Move constructor |