diff options
author | Maciej Żenczykowski <maze@google.com> | 2020-04-24 17:51:46 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-04-24 17:51:46 +0000 |
commit | 9a94889fdb600e1c3de50f823d5311d40fe61cc7 (patch) | |
tree | 206a9ee3254ca45160b6db68fb6ac12cd10391bb | |
parent | d45ecd814d016d3c1cd61c0b28f857fb2f355541 (diff) | |
parent | c0ccdf30c058433400d0ffe656254270a821bc9c (diff) | |
download | platform_system_bpf-9a94889fdb600e1c3de50f823d5311d40fe61cc7.tar.gz platform_system_bpf-9a94889fdb600e1c3de50f823d5311d40fe61cc7.tar.bz2 platform_system_bpf-9a94889fdb600e1c3de50f823d5311d40fe61cc7.zip |
BpfMap.h - fix cert-oop54-cpp compiler warning am: eaa7b9eb3f am: a0ada33476 am: c0ccdf30c0
Change-Id: I0deb5655ea2cd5d1e88fadae64ac906e13ae7e5f
-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 |