mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
@@ -14,7 +14,6 @@
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::io::{File, BufferedWriter, BufferedReader, stdin, print};
|
||||
use getopts::{optopt, optflag, getopts, usage};
|
||||
|
||||
@@ -414,9 +413,6 @@ fn cut_files(mut filenames: Vec<String>, mode: Mode) -> int {
|
||||
exit_code
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn main() { os::set_exit_status(uumain(os::args())); }
|
||||
|
||||
pub fn uumain(args: Vec<String>) -> int {
|
||||
let opts = [
|
||||
optopt("b", "bytes", "select only these bytes", "LIST"),
|
||||
|
||||
+5
-5
@@ -35,7 +35,10 @@ extern {
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn rewind_stdout<T: std::rt::rtio::RtioFileStream>(s: &mut T) {
|
||||
s.seek(0, std::rt::rtio::SeekEnd);
|
||||
match s.seek(0, std::rt::rtio::SeekEnd) {
|
||||
Ok(_) => {}
|
||||
Err(f) => crash!(1, "{}", f.detail.unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
@@ -46,9 +49,6 @@ fn _vprocmgr_detach_from_console(_: u32) -> *libc::c_int { std::ptr::null() }
|
||||
#[cfg(target_os = "freebsd")]
|
||||
fn rewind_stdout<T: std::rt::rtio::RtioFileStream>(_: &mut T) {}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn main () { std::os::set_exit_status(uumain(std::os::args())); }
|
||||
|
||||
pub fn uumain(args: Vec<String>) -> int {
|
||||
let program = args.get(0);
|
||||
|
||||
@@ -78,7 +78,7 @@ pub fn uumain(args: Vec<String>) -> 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
|
||||
|
||||
Reference in New Issue
Block a user