From ae4ad2bb04bb5c6c03e70864ea6e35880dfe601e Mon Sep 17 00:00:00 2001 From: Arcterus Date: Sat, 28 Jun 2014 16:45:10 -0700 Subject: [PATCH] Remove useless main functions and fix nohup on Macs --- cut/cut.rs | 3 --- nohup/nohup.rs | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/cut/cut.rs b/cut/cut.rs index 16cc56636..9cc353b8a 100644 --- a/cut/cut.rs +++ b/cut/cut.rs @@ -414,9 +414,6 @@ fn cut_files(mut filenames: Vec, mode: Mode) -> int { exit_code } -#[allow(dead_code)] -fn main() { os::set_exit_status(uumain(os::args())); } - pub fn uumain(args: Vec) -> int { let opts = [ optopt("b", "bytes", "select only these bytes", "LIST"), diff --git a/nohup/nohup.rs b/nohup/nohup.rs index 4c7c493c3..75bf1f36a 100644 --- a/nohup/nohup.rs +++ b/nohup/nohup.rs @@ -46,9 +46,6 @@ fn _vprocmgr_detach_from_console(_: u32) -> *libc::c_int { std::ptr::null() } #[cfg(target_os = "freebsd")] fn rewind_stdout(_: &mut T) {} -#[allow(dead_code)] -fn main () { std::os::set_exit_status(uumain(std::os::args())); } - pub fn uumain(args: Vec) -> int { let program = args.get(0); @@ -78,7 +75,7 @@ pub fn uumain(args: Vec) -> int { unsafe { signal(SIGHUP, SIG_IGN) }; - if _vprocmgr_detach_from_console(0) != std::ptr::null() { crash!(2, "Cannot detach from console")}; + if unsafe { _vprocmgr_detach_from_console(0) } != std::ptr::null() { crash!(2, "Cannot detach from console")}; unsafe { // we ignore the memory leak here because it doesn't matter anymore