mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 12:05:30 +00:00
Pass int directly as pointer
This commit is contained in:
parent
17981730a4
commit
b44f5122fd
@ -39,8 +39,7 @@ static void remove_modules() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *request_handler(void *args) {
|
static void *request_handler(void *args) {
|
||||||
int client = *((int *) args);
|
int client = reinterpret_cast<intptr_t>(args);
|
||||||
delete (int *) args;
|
|
||||||
|
|
||||||
struct ucred credential;
|
struct ucred credential;
|
||||||
get_client_cred(client, &credential);
|
get_client_cred(client, &credential);
|
||||||
@ -173,9 +172,8 @@ static void main_daemon() {
|
|||||||
|
|
||||||
// Loop forever to listen for requests
|
// Loop forever to listen for requests
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int *client = new int;
|
int client = xaccept4(fd, nullptr, nullptr, SOCK_CLOEXEC);
|
||||||
*client = xaccept4(fd, nullptr, nullptr, SOCK_CLOEXEC);
|
new_daemon_thread(request_handler, reinterpret_cast<void*>(client));
|
||||||
new_daemon_thread(request_handler, client);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user