Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit 8bb290c

Browse files
committed
Use volatile for ksu_fd
1 parent b081f8d commit 8bb290c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

daemon/src/main/jni/denylist.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,14 @@ bool exec_command(char *buf, size_t len, const char *file, const char *argv[]) {
9090
*/
9191
static int root_impl = -1;
9292

93-
static int ksu_fd = -1;
93+
volatile int ksu_fd = -1;
9494

9595
static bool prepare_ksu_fd() {
9696
if (ksu_fd >= 0) return true;
9797

9898
LOGD("Prepare KSU fd: Trying to send ksu option");
9999

100-
syscall(
101-
SYS_reboot,
102-
KSU_INSTALL_MAGIC1,
103-
KSU_INSTALL_MAGIC2,
104-
0,
105-
(void *)&ksu_fd
106-
);
100+
syscall(SYS_reboot, KSU_INSTALL_MAGIC1, KSU_INSTALL_MAGIC2, 0, (void*)&ksu_fd);
107101

108102
LOGD("Prepare KSU fd: %x", ksu_fd);
109103

0 commit comments

Comments
 (0)