Skip to content

Commit 6b73967

Browse files
authored
style: fix unused imports for macOS (#1092)
1 parent de39cc6 commit 6b73967

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ddcommon/src/unix_utils.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
#![cfg(unix)]
55

66
use anyhow::Context;
7-
use libc::{_exit, execve, nfds_t, pid_t, poll, pollfd, EXIT_FAILURE, POLLHUP};
7+
use libc::{_exit, execve, nfds_t, poll, pollfd, EXIT_FAILURE, POLLHUP};
88
use nix::errno::Errno;
99
use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus};
1010
use nix::unistd::Pid;
11-
use std::io::{self, BufRead, BufReader};
1211
use std::os::fd::IntoRawFd;
1312
use std::time::{Duration, Instant};
1413
use std::{
@@ -17,6 +16,9 @@ use std::{
1716
os::fd::RawFd,
1817
};
1918

19+
#[cfg(target_os = "linux")]
20+
use std::io::{self, BufRead, BufReader};
21+
2022
// The args_cstrings and env_vars_strings fields are just storage. Even though they're
2123
// unreferenced, they're a necessary part of the struct.
2224
#[allow(dead_code)]
@@ -201,9 +203,9 @@ fn is_being_traced() -> io::Result<bool> {
201203
}
202204

203205
#[cfg(target_os = "linux")]
204-
pub fn alt_fork() -> pid_t {
206+
pub fn alt_fork() -> libc::pid_t {
205207
use libc::{
206-
c_ulong, c_void, syscall, SYS_clone, CLONE_CHILD_CLEARTID, CLONE_CHILD_SETTID,
208+
c_ulong, c_void, pid_t, syscall, SYS_clone, CLONE_CHILD_CLEARTID, CLONE_CHILD_SETTID,
207209
CLONE_PTRACE, SIGCHLD,
208210
};
209211

0 commit comments

Comments
 (0)