Merge "use mapRetrieveRO() instead of bpf_obj_get()" am: 81329bd9e9 am: ced7df1d56 am: b0f95435d6

Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2143733

Change-Id: Ia36bb839e47bd8ae73a03441efc8b6364edb5983
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Maciej Żenczykowski 2022-07-01 21:01:33 +00:00 committed by Automerger Merge Worker
commit 4d02939973

View file

@ -30,9 +30,9 @@
#include <sys/wait.h>
#include <unistd.h>
// This is BpfLoader v0.19
// This is BpfLoader v0.20
#define BPFLOADER_VERSION_MAJOR 0u
#define BPFLOADER_VERSION_MINOR 19u
#define BPFLOADER_VERSION_MINOR 20u
#define BPFLOADER_VERSION ((BPFLOADER_VERSION_MAJOR << 16) | BPFLOADER_VERSION_MINOR)
#include "bpf/BpfUtils.h"
@ -822,7 +822,7 @@ static int createMaps(const char* elfPath, ifstream& elfFile, vector<unique_fd>&
int saved_errno;
if (access(mapPinLoc.c_str(), F_OK) == 0) {
fd.reset(bpf_obj_get(mapPinLoc.c_str()));
fd.reset(mapRetrieveRO(mapPinLoc.c_str()));
saved_errno = errno;
ALOGD("bpf_create_map reusing map %s, ret: %d", mapNames[i].c_str(), fd.get());
reuse = true;