mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Handle the situation when connect_daemon returns -1
Fix #10117, close #10141
This commit is contained in:
@@ -97,7 +97,9 @@ int denylist_cli(rust::Vec<rust::String> &args) {
|
||||
}
|
||||
|
||||
// Send request
|
||||
int fd = connect_daemon(RequestCode::DENYLIST);
|
||||
owned_fd fd = connect_daemon(RequestCode::DENYLIST);
|
||||
if (fd < 0) exit(1);
|
||||
|
||||
write_int(fd, req);
|
||||
if (req == DenyRequest::ADD || req == DenyRequest::REMOVE) {
|
||||
write_string(fd, argv[1]);
|
||||
|
||||
@@ -210,6 +210,7 @@ end:
|
||||
|
||||
// Connect to client
|
||||
owned_fd fd = connect_daemon(RequestCode::SUPERUSER);
|
||||
if (fd < 0) exit(1);
|
||||
|
||||
// Send request
|
||||
req.write_to_fd(fd);
|
||||
|
||||
Reference in New Issue
Block a user