mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Fixed most issues caused by libc being moved from std to it's own crate.
I just did a quick pass and fixed a majority of the simple issues but there are still some problems with the following utils: id md5sum tee uptime users whoami
This commit is contained in:
parent
9764c3220a
commit
27ed81322c
27 changed files with 34 additions and 10 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
extern crate serialize;
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
#[phase(syntax, link)] extern crate log;
|
||||
|
||||
use std::char;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::io::{print, println};
|
||||
use std::os;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
extern crate getopts;
|
||||
|
||||
use std::libc::{
|
||||
use libc::{
|
||||
c_char,
|
||||
c_int,
|
||||
uid_t,
|
||||
|
|
|
@ -30,7 +30,7 @@ macro_rules! show_warning(
|
|||
macro_rules! crash(
|
||||
($exitcode:expr, $($args:expr),+) => ({
|
||||
show_error!($exitcode, $($args),+);
|
||||
unsafe { ::std::libc::exit($exitcode as ::std::libc::c_int); }
|
||||
unsafe { ::libc::exit($exitcode as ::libc::c_int); }
|
||||
})
|
||||
)
|
||||
|
||||
|
@ -38,7 +38,7 @@ macro_rules! crash(
|
|||
#[macro_export]
|
||||
macro_rules! exit(
|
||||
($exitcode:expr) => ({
|
||||
unsafe { ::std::libc::exit($exitcode); }
|
||||
unsafe { ::libc::exit($exitcode); }
|
||||
})
|
||||
)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
pub use self::utmpx::{DEFAULT_FILE,USER_PROCESS,BOOT_TIME,c_utmp};
|
||||
#[cfg(target_os = "linux")]
|
||||
mod utmpx {
|
||||
use std::libc;
|
||||
use libc;
|
||||
|
||||
pub static DEFAULT_FILE: &'static str = "/var/run/utmp";
|
||||
|
||||
|
@ -48,7 +48,7 @@ mod utmpx {
|
|||
|
||||
#[cfg(target_os = "macos")]
|
||||
mod utmpx {
|
||||
use std::libc;
|
||||
use libc;
|
||||
|
||||
pub static DEFAULT_FILE: &'static str = "/var/run/utmpx";
|
||||
|
||||
|
|
1
du/du.rs
1
du/du.rs
|
@ -13,6 +13,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
extern crate sync;
|
||||
extern crate time;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![feature(macro_rules)]
|
||||
#![crate_id(name="echo", vers="1.0.0", author="Derek Chiang")]
|
||||
#[crate_id(name="echo", vers="1.0.0", author="Derek Chiang")]
|
||||
|
||||
/*
|
||||
* This file is part of the uutils coreutils package.
|
||||
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::io::{print, println};
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::io;
|
||||
use std::io::fs::File;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use getopts::{
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
extern crate getopts;
|
||||
extern crate collections;
|
||||
extern crate serialize;
|
||||
extern crate libc;
|
||||
|
||||
|
||||
#[phase(syntax, link)] extern crate log;
|
||||
|
@ -27,7 +28,7 @@ use getopts::{
|
|||
usage,
|
||||
};
|
||||
|
||||
use std::libc::{c_long};
|
||||
use libc::{c_long};
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
mod util;
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
*/
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::{os,libc,str};
|
||||
use std::{os,str};
|
||||
use getopts::{optflag, getopts, usage};
|
||||
|
||||
extern {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
extern crate collections;
|
||||
extern crate serialize;
|
||||
|
||||
|
|
|
@ -16,11 +16,12 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::io::{print, println};
|
||||
use std::os;
|
||||
use std::str;
|
||||
use std::libc;
|
||||
use libc::c_char;
|
||||
|
||||
#[path = "../common/util.rs"] mod util;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::io::fs;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::io;
|
||||
use std::os;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::io::print;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::io::print;
|
||||
|
|
1
rm/rm.rs
1
rm/rm.rs
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::io::{print, stdin, stdio, fs, BufferedReader};
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::io::{print, fs};
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// TODO: Support -f flag
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::num;
|
||||
use std::cast;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::io;
|
||||
use std::os;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::io::{File, Open, ReadWrite, fs};
|
||||
use std::os;
|
||||
|
|
|
@ -17,8 +17,9 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::{libc,str,os};
|
||||
use std::{str,os};
|
||||
use std::io::println;
|
||||
use std::io::stdio::stderr;
|
||||
use getopts::{optflag,getopts};
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::mem::uninit;
|
||||
|
|
1
wc/wc.rs
1
wc/wc.rs
|
@ -12,6 +12,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::str::from_utf8;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#![feature(macro_rules)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
|
||||
use std::os;
|
||||
use std::io::{print, println};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue