mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 09:48:03 +00:00
nohup: fix build on Macs (closes #463)
This commit is contained in:
parent
5e581907c1
commit
75b992feac
1 changed files with 0 additions and 13 deletions
|
@ -33,20 +33,9 @@ extern {
|
|||
fn _vprocmgr_detach_from_console(flags: u32) -> *const libc::c_int;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn rewind_stdout(s: Fd) {
|
||||
match s.seek(0, io::SeekEnd) {
|
||||
Ok(_) => {}
|
||||
Err(f) => crash!(1, "{}", f.detail.into_inner())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
unsafe fn _vprocmgr_detach_from_console(_: u32) -> *const libc::c_int { std::ptr::null() }
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
fn rewind_stdout(_: Fd) {}
|
||||
|
||||
pub fn uumain(args: Vec<String>) -> int {
|
||||
let program = &args[0];
|
||||
|
||||
|
@ -108,8 +97,6 @@ fn replace_fds() {
|
|||
let new_stdout = find_stdout();
|
||||
let fd = new_stdout.as_raw_fd();
|
||||
|
||||
rewind_stdout(fd);
|
||||
|
||||
if unsafe { dup2(fd, 1) } != 1 {
|
||||
crash!(2, "Cannot replace STDOUT: {}", std::io::IoError::last_error())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue