Skip to content

Commit

Permalink
Snap for 10017868 from bc516a9 to udc-qpr1-release
Browse files Browse the repository at this point in the history
Change-Id: I38273248287a7a2b8fc90e79a864f1c6e29c371e
  • Loading branch information
Android Build Coastguard Worker committed Apr 28, 2023
2 parents e00e39c + bc516a9 commit 4f0fd3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libbpf_android/Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define LOG_TAG "LibBpfLoader"

#include <errno.h>
#include <fcntl.h>
#include <linux/bpf.h>
#include <linux/elf.h>
#include <log/log.h>
Expand Down Expand Up @@ -901,7 +902,8 @@ static int createMaps(const char* elfPath, ifstream& elfFile, vector<unique_fd>&
ALOGE("create %s -> %d [%d:%s]", createLoc.c_str(), ret, err, strerror(err));
return -err;
}
ret = rename(createLoc.c_str(), mapPinLoc.c_str());
ret = renameat2(AT_FDCWD, createLoc.c_str(),
AT_FDCWD, mapPinLoc.c_str(), RENAME_NOREPLACE);
if (ret) {
int err = errno;
ALOGE("rename %s %s -> %d [%d:%s]", createLoc.c_str(), mapPinLoc.c_str(), ret,
Expand Down Expand Up @@ -1153,7 +1155,8 @@ static int loadCodeSections(const char* elfPath, vector<codeSection>& cs, const
ALOGE("create %s -> %d [%d:%s]", createLoc.c_str(), ret, err, strerror(err));
return -err;
}
ret = rename(createLoc.c_str(), progPinLoc.c_str());
ret = renameat2(AT_FDCWD, createLoc.c_str(),
AT_FDCWD, progPinLoc.c_str(), RENAME_NOREPLACE);
if (ret) {
int err = errno;
ALOGE("rename %s %s -> %d [%d:%s]", createLoc.c_str(), progPinLoc.c_str(), ret,
Expand Down

0 comments on commit 4f0fd3f

Please sign in to comment.