mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-09 13:05:52 +00:00
Cleanup file descriptors
This commit is contained in:
@@ -221,6 +221,8 @@ int run_command(int *fd, const char *path, char *const argv[]) {
|
||||
if (socketpair(AF_LOCAL, SOCK_STREAM, 0, sv) == -1)
|
||||
return -1;
|
||||
// We use sv[0], give them sv[1] for communication
|
||||
if (fcntl(sv[1], F_SETFD, FD_CLOEXEC))
|
||||
PLOGE("fcntl FD_CLOEXEC");
|
||||
*fd = sv[1];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user