Merge "use mapRetrieveRO() instead of bpf_obj_get()"

This commit is contained in:
Maciej Żenczykowski 2022-07-01 20:01:30 +00:00 committed by Gerrit Code Review
commit 81329bd9e9

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;