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

mknod: rename function _mknod to mknod (#7824)

This commit is contained in:
Daniel Hofstetter 2025-04-23 11:03:37 +02:00 committed by GitHub
parent 67400abd70
commit 482f882b4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,7 +55,7 @@ pub struct Config<'a> {
pub context: Option<&'a String>,
}
fn _mknod(file_name: &str, config: Config) -> i32 {
fn mknod(file_name: &str, config: Config) -> i32 {
let c_str = CString::new(file_name).expect("Failed to convert to CString");
// the user supplied a mode
@ -127,7 +127,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
))
} else {
config.mode = S_IFIFO | mode;
let exit_code = _mknod(file_name, config);
let exit_code = mknod(file_name, config);
set_exit_code(exit_code);
Ok(())
}
@ -146,11 +146,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let exit_code = match file_type {
FileType::Block => {
config.mode |= S_IFBLK;
_mknod(file_name, config)
mknod(file_name, config)
}
FileType::Character => {
config.mode |= S_IFCHR;
_mknod(file_name, config)
mknod(file_name, config)
}
FileType::Fifo => {
unreachable!("file_type was validated to be only block or character")