1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

Merge pull request #1111 from Arcterus/mode-to-uucore

mknod, stdbuf: fix build
This commit is contained in:
mpkh 2017-12-11 14:11:16 +04:00 committed by GitHub
commit 372dda9dfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View file

@ -8,9 +8,9 @@ pub fn parse_mode(mode: Option<String>) -> Result<mode_t, String> {
if let Some(mode) = mode { if let Some(mode) = mode {
let arr: &[char] = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; let arr: &[char] = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
let result = if mode.contains(arr) { let result = if mode.contains(arr) {
mode::parse_numeric(fperm, mode.as_str()) mode::parse_numeric(fperm as u32, mode.as_str())
} else { } else {
mode::parse_symbolic(fperm, mode.as_str(), true) mode::parse_symbolic(fperm as u32, mode.as_str(), true)
}; };
result.map(|mode| mode as mode_t) result.map(|mode| mode as mode_t)
} else { } else {

View file

@ -52,14 +52,8 @@ fn main() {
} }
link.arg("-o") link.arg("-o")
.arg(format!("{}/libstdbuf.{}", out_dir, platform::DYLIB_EXT)) .arg(format!("{}/libstdbuf.{}", out_dir, platform::DYLIB_EXT))
.arg(format!("{}/libstdbuf.a", out_dir)); .arg(format!("{}/libstdbuf.a", out_dir))
if platform::DYLIB_LINK_START.len() > 0 { .arg(entry);
link.arg(platform::DYLIB_LINK_START);
}
link.arg(entry);
if platform::DYLIB_LINK_END.len() > 0 {
link.arg(platform::DYLIB_LINK_END);
}
if !link.spawn().unwrap().wait().unwrap().success() { if !link.spawn().unwrap().wait().unwrap().success() {
panic!("linking failed"); panic!("linking failed");
} }