mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 13:07:46 +00:00
os::errno returns uint now
This commit is contained in:
parent
5e3183371b
commit
f3fc1b72ff
3 changed files with 4 additions and 4 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 {
|
||||||
|
|
|
@ -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