mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-09 11:45:40 -08:00
Cleanup cpio codebase
This commit is contained in:
@@ -463,11 +463,21 @@ bool byte_data::contains(string_view pattern, bool log) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool byte_data::equals(const byte_data &o) const {
|
||||
return sz == o.sz && memcmp(buf, o.buf, sz) == 0;
|
||||
}
|
||||
|
||||
void byte_data::swap(byte_data &o) {
|
||||
std::swap(buf, o.buf);
|
||||
std::swap(sz, o.sz);
|
||||
}
|
||||
|
||||
heap_data byte_data::clone() const {
|
||||
heap_data copy(sz);
|
||||
memcpy(copy.buf, buf, sz);
|
||||
return copy;
|
||||
}
|
||||
|
||||
mmap_data::mmap_data(const char *name, bool rw) {
|
||||
int fd = xopen(name, (rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
|
||||
Reference in New Issue
Block a user