Skip to content

Commit b5cbdcc

Browse files
committed
Fix android build
Ensure fd variable are defined on android Signed-off-by: Dustin Thomson <[email protected]>
1 parent 44b31f7 commit b5cbdcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sync/sys/unix/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl PipeListener {
6262
}
6363

6464
fn new_monitor_fd() -> Result<(i32, i32)> {
65-
#[cfg(target_os = "linux")]
65+
#[cfg(any(target_os = "linux", target_os = "android"))]
6666
let fds = pipe2(nix::fcntl::OFlag::O_CLOEXEC)?;
6767

6868

@@ -128,7 +128,7 @@ impl PipeListener {
128128
return Err(io::Error::new(io::ErrorKind::Other, "listener shutdown for quit flag"));
129129
}
130130

131-
#[cfg(target_os = "linux")]
131+
#[cfg(any(target_os = "linux", target_os = "android"))]
132132
let fd = match accept4(self.fd, SockFlag::SOCK_CLOEXEC) {
133133
Ok(fd) => fd,
134134
Err(e) => {

0 commit comments

Comments
 (0)