mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
chore: consistent code branding (#2800)
* chore: consistent code branding * fix: carry legacy overrides, queues and live sync rows across the rename * fix: keep queued legacy overrides on a failed rename and separate merged queue entries
This commit is contained in:
1 parent
ad9348879d
commit
eabcfc7b74
229 files changed
+2584
-2468
No files matched your search
@@ -98,11 +98,11 @@ static int (*fs_real_shm_unlink)(const char *);
|
||||
static void *(*fs_real_mmap)(void *, size_t, int, int, int, off_t);
|
||||
static void *(*fs_real_mmap64)(void *, size_t, int, int, int, off64_t);
|
||||
static int (*fs_real_munmap)(void *, size_t);
|
||||
__attribute__((visibility("hidden"))) int bl_noexec_retry(int prot, int flags, int fd);
|
||||
__attribute__((visibility("hidden"))) int dd_noexec_retry(int prot, int flags, int fd);
|
||||
|
||||
static int fs_on(void) {
|
||||
if (fs_state < 0) {
|
||||
const char *e = getenv("BL_FSYNC");
|
||||
const char *e = getenv("DD_FSYNC");
|
||||
fs_state = e && e[0] == '1';
|
||||
}
|
||||
return fs_state;
|
||||
@@ -511,14 +511,14 @@ static long fs_wake(uint32_t key, int n) {
|
||||
return woken;
|
||||
}
|
||||
|
||||
void bl_fsync_fds_closed(unsigned int first, unsigned int last) __attribute__((visibility("hidden")));
|
||||
void bl_fsync_fds_closed(unsigned int first, unsigned int last) {
|
||||
void dd_fsync_fds_closed(unsigned int first, unsigned int last) __attribute__((visibility("hidden")));
|
||||
void dd_fsync_fds_closed(unsigned int first, unsigned int last) {
|
||||
int fd = __atomic_load_n(&fs_fd, __ATOMIC_ACQUIRE);
|
||||
if (fd >= 0 && (unsigned int)fd >= first && (unsigned int)fd <= last) __atomic_store_n(&fs_fd, -1, __ATOMIC_RELEASE);
|
||||
}
|
||||
|
||||
int bl_fsync_syscall(long number, const long *args, long *ret) __attribute__((visibility("hidden")));
|
||||
int bl_fsync_syscall(long number, const long *args, long *ret) {
|
||||
int dd_fsync_syscall(long number, const long *args, long *ret) __attribute__((visibility("hidden")));
|
||||
int dd_fsync_syscall(long number, const long *args, long *ret) {
|
||||
if (number == SYS_futex_waitv) {
|
||||
if (!fs_on()) return 0;
|
||||
if (!args[0] && !args[1]) {
|
||||
@@ -617,15 +617,15 @@ int shm_unlink(const char *name) {
|
||||
return r;
|
||||
}
|
||||
|
||||
int bl_venc_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off,
|
||||
int dd_venc_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off,
|
||||
void *(*real)(void *, size_t, int, int, int, off_t), void **out) __attribute__((weak, visibility("hidden")));
|
||||
|
||||
void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off) {
|
||||
void *p;
|
||||
if (!fs_real_mmap) fs_real_mmap = (void *(*)(void *, size_t, int, int, int, off_t))dlsym(RTLD_NEXT, "mmap");
|
||||
if (bl_venc_mmap && bl_venc_mmap(addr, len, prot, flags, fd, off, fs_real_mmap, &p)) return p;
|
||||
if (dd_venc_mmap && dd_venc_mmap(addr, len, prot, flags, fd, off, fs_real_mmap, &p)) return p;
|
||||
p = fs_real_mmap(addr, len, prot, flags, fd, off);
|
||||
if (p == MAP_FAILED && bl_noexec_retry(prot, flags, fd)) p = fs_real_mmap(addr, len, prot & ~PROT_EXEC, flags, fd, off);
|
||||
if (p == MAP_FAILED && dd_noexec_retry(prot, flags, fd)) p = fs_real_mmap(addr, len, prot & ~PROT_EXEC, flags, fd, off);
|
||||
if (p != MAP_FAILED && __builtin_expect(fs_fd >= 0, 0)) fs_track(p, len, flags, fd, off);
|
||||
return p;
|
||||
}
|
||||
@@ -633,10 +633,10 @@ void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off) {
|
||||
void *mmap64(void *addr, size_t len, int prot, int flags, int fd, off64_t off) {
|
||||
void *p;
|
||||
if (!fs_real_mmap64) fs_real_mmap64 = (void *(*)(void *, size_t, int, int, int, off64_t))dlsym(RTLD_NEXT, "mmap64");
|
||||
if (bl_venc_mmap && bl_venc_mmap(addr, len, prot, flags, fd, off, (void *(*)(void *, size_t, int, int, int, off_t))fs_real_mmap64, &p))
|
||||
if (dd_venc_mmap && dd_venc_mmap(addr, len, prot, flags, fd, off, (void *(*)(void *, size_t, int, int, int, off_t))fs_real_mmap64, &p))
|
||||
return p;
|
||||
p = fs_real_mmap64(addr, len, prot, flags, fd, off);
|
||||
if (p == MAP_FAILED && bl_noexec_retry(prot, flags, fd)) p = fs_real_mmap64(addr, len, prot & ~PROT_EXEC, flags, fd, off);
|
||||
if (p == MAP_FAILED && dd_noexec_retry(prot, flags, fd)) p = fs_real_mmap64(addr, len, prot & ~PROT_EXEC, flags, fd, off);
|
||||
if (p != MAP_FAILED && __builtin_expect(fs_fd >= 0, 0)) fs_track(p, len, flags, fd, off);
|
||||
return p;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user