mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 21:17:46 +00:00
Merge pull request #446 from ebfe/fix-build-master
Fix build with rust master
This commit is contained in:
commit
a5d70763bc
4 changed files with 7 additions and 7 deletions
|
@ -186,7 +186,7 @@ unsafe fn get_group_list_internal(name: *const c_char, gid: gid_t, groups: *mut
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_groups() -> Result<Vec<gid_t>, int> {
|
pub fn get_groups() -> Result<Vec<gid_t>, uint> {
|
||||||
let ngroups = unsafe { getgroups(0, null_mut()) };
|
let ngroups = unsafe { getgroups(0, null_mut()) };
|
||||||
if ngroups == -1 {
|
if ngroups == -1 {
|
||||||
return Err(os::errno());
|
return Err(os::errno());
|
||||||
|
@ -210,7 +210,7 @@ pub fn group(possible_pw: Option<c_passwd>, nflag: bool) {
|
||||||
|
|
||||||
match groups {
|
match groups {
|
||||||
Err(errno) =>
|
Err(errno) =>
|
||||||
crash!(1, "failed to get group list (errno={:d})", errno),
|
crash!(1, "failed to get group list (errno={:u})", errno),
|
||||||
Ok(groups) => {
|
Ok(groups) => {
|
||||||
for &g in groups.iter() {
|
for &g in groups.iter() {
|
||||||
if nflag {
|
if nflag {
|
||||||
|
|
|
@ -325,7 +325,7 @@ Try '{} --help' for more information.", s, program);
|
||||||
false => stat.fstat.unstable.blocks * 512,
|
false => stat.fstat.unstable.blocks * 512,
|
||||||
};
|
};
|
||||||
if matches.opt_present("time") {
|
if matches.opt_present("time") {
|
||||||
let time_str = {
|
let tm = {
|
||||||
let (secs, nsecs) = {
|
let (secs, nsecs) = {
|
||||||
let time = match matches.opt_str("time") {
|
let time = match matches.opt_str("time") {
|
||||||
Some(s) => match s.as_slice() {
|
Some(s) => match s.as_slice() {
|
||||||
|
@ -344,10 +344,10 @@ Try '{} --help' for more information.", s, program);
|
||||||
};
|
};
|
||||||
((time / 1000) as i64, (time % 1000 * 1000000) as i32)
|
((time / 1000) as i64, (time % 1000 * 1000000) as i32)
|
||||||
};
|
};
|
||||||
let time_spec = Timespec::new(secs, nsecs);
|
time::at(Timespec::new(secs, nsecs))
|
||||||
time::at(time_spec).strftime(time_format_str)
|
|
||||||
};
|
};
|
||||||
if !summarize || (summarize && index == len-1) {
|
if !summarize || (summarize && index == len-1) {
|
||||||
|
let time_str = tm.strftime(time_format_str).unwrap();
|
||||||
print!("{}\t{}\t{}{}", convert_size(size), time_str, stat.path.display(), line_separator);
|
print!("{}\t{}\t{}{}", convert_size(size), time_str, stat.path.display(), line_separator);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -345,7 +345,7 @@ fn id_print(possible_pw: Option<c_passwd>,
|
||||||
};
|
};
|
||||||
|
|
||||||
let groups = groups.unwrap_or_else(|errno| {
|
let groups = groups.unwrap_or_else(|errno| {
|
||||||
crash!(1, "failed to get group list (errno={:d})", errno);
|
crash!(1, "failed to get group list (errno={:u})", errno);
|
||||||
});
|
});
|
||||||
|
|
||||||
if possible_pw.is_some() {
|
if possible_pw.is_some() {
|
||||||
|
|
|
@ -69,7 +69,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||||
f.with_c_str(|name| {
|
f.with_c_str(|name| {
|
||||||
let err = unsafe { mkfifo(name, mode) };
|
let err = unsafe { mkfifo(name, mode) };
|
||||||
if err == -1 {
|
if err == -1 {
|
||||||
show_error!("creating '{}': {}", f, os::error_string(os::errno() as uint));
|
show_error!("creating '{}': {}", f, os::error_string(os::errno()));
|
||||||
exit_status = 1;
|
exit_status = 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue