mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 12:05:30 +00:00
Returned fds[0] in socketpair() might be STDOUT
* There will be garbage output when executing `su` (#4016) * Failed to check root status and showing N/A in status (#4005) Signed-off-by: Shaka Huang <shakalaca@gmail.com>
This commit is contained in:
parent
a6f81c66e5
commit
b9cdc755d1
@ -172,8 +172,6 @@ static int switch_cgroup(const char *cgroup, int pid) {
|
||||
// Change process name
|
||||
set_nice_name("magiskd");
|
||||
|
||||
magisk_logging();
|
||||
|
||||
int fd = xopen("/dev/null", O_WRONLY);
|
||||
xdup2(fd, STDOUT_FILENO);
|
||||
xdup2(fd, STDERR_FILENO);
|
||||
@ -184,6 +182,8 @@ static int switch_cgroup(const char *cgroup, int pid) {
|
||||
if (fd > STDERR_FILENO)
|
||||
close(fd);
|
||||
|
||||
magisk_logging();
|
||||
|
||||
setsid();
|
||||
setcon("u:r:" SEPOL_PROC_DOMAIN ":s0");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user