mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-02 14:07:46 +00:00
Merge pull request #606 from jbcrail/fix-linux-build-for-mkfifo
Fix mkfifo on Linux.
This commit is contained in:
commit
b02dff807a
1 changed files with 2 additions and 2 deletions
|
@ -55,7 +55,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mode = match matches.opt_str("m") {
|
let mode = match matches.opt_str("m") {
|
||||||
Some(m) => match u16::from_str_radix(&m, 8) {
|
Some(m) => match usize::from_str_radix(&m, 8) {
|
||||||
Ok(m) => m,
|
Ok(m) => m,
|
||||||
Err(e)=> {
|
Err(e)=> {
|
||||||
show_error!("invalid mode: {}", e);
|
show_error!("invalid mode: {}", e);
|
||||||
|
@ -67,7 +67,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
let mut exit_status = 0;
|
let mut exit_status = 0;
|
||||||
for f in matches.free.iter() {
|
for f in matches.free.iter() {
|
||||||
let err = unsafe { mkfifo(CString::new(f.as_bytes()).unwrap().as_ptr(), mode) };
|
let err = unsafe { mkfifo(CString::new(f.as_bytes()).unwrap().as_ptr(), mode as libc::mode_t) };
|
||||||
if err == -1 {
|
if err == -1 {
|
||||||
show_error!("creating '{}': {}", f, Error::last_os_error().raw_os_error().unwrap());
|
show_error!("creating '{}': {}", f, Error::last_os_error().raw_os_error().unwrap());
|
||||||
exit_status = 1;
|
exit_status = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue