mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
mknod: remove windows-related code & flags
This commit is contained in:
parent
77c4ba5bea
commit
9e7f3acbc7
2 changed files with 0 additions and 16 deletions
|
@ -26,11 +26,6 @@ fn makedev(maj: u64, min: u64) -> dev_t {
|
||||||
((min & 0xff) | ((maj & 0xfff) << 8) | ((min & !0xff) << 12) | ((maj & !0xfff) << 32)) as dev_t
|
((min & 0xff) | ((maj & 0xfff) << 8) | ((min & !0xff) << 12) | ((maj & !0xfff) << 32)) as dev_t
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
fn _mknod(file_name: &str, mode: mode_t, dev: dev_t) -> i32 {
|
|
||||||
panic!("Unsupported for windows platform")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, PartialEq)]
|
#[derive(Clone, PartialEq)]
|
||||||
enum FileType {
|
enum FileType {
|
||||||
Block,
|
Block,
|
||||||
|
@ -38,7 +33,6 @@ enum FileType {
|
||||||
Fifo,
|
Fifo,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
|
||||||
fn _mknod(file_name: &str, mode: mode_t, dev: dev_t) -> i32 {
|
fn _mknod(file_name: &str, mode: mode_t, dev: dev_t) -> i32 {
|
||||||
let c_str = CString::new(file_name).expect("Failed to convert to CString");
|
let c_str = CString::new(file_name).expect("Failed to convert to CString");
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,10 @@ use uutests::util::TestScenario;
|
||||||
use uutests::util_name;
|
use uutests::util_name;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_invalid_arg() {
|
fn test_invalid_arg() {
|
||||||
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);
|
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_mknod_help() {
|
fn test_mknod_help() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
|
@ -23,7 +21,6 @@ fn test_mknod_help() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_mknod_version() {
|
fn test_mknod_version() {
|
||||||
assert!(
|
assert!(
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
|
@ -36,7 +33,6 @@ fn test_mknod_version() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_mknod_fifo_default_writable() {
|
fn test_mknod_fifo_default_writable() {
|
||||||
let ts = TestScenario::new(util_name!());
|
let ts = TestScenario::new(util_name!());
|
||||||
ts.ucmd().arg("test_file").arg("p").succeeds();
|
ts.ucmd().arg("test_file").arg("p").succeeds();
|
||||||
|
@ -45,7 +41,6 @@ fn test_mknod_fifo_default_writable() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_mknod_fifo_mnemonic_usage() {
|
fn test_mknod_fifo_mnemonic_usage() {
|
||||||
let ts = TestScenario::new(util_name!());
|
let ts = TestScenario::new(util_name!());
|
||||||
ts.ucmd().arg("test_file").arg("pipe").succeeds();
|
ts.ucmd().arg("test_file").arg("pipe").succeeds();
|
||||||
|
@ -53,7 +48,6 @@ fn test_mknod_fifo_mnemonic_usage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_mknod_fifo_read_only() {
|
fn test_mknod_fifo_read_only() {
|
||||||
let ts = TestScenario::new(util_name!());
|
let ts = TestScenario::new(util_name!());
|
||||||
ts.ucmd()
|
ts.ucmd()
|
||||||
|
@ -67,7 +61,6 @@ fn test_mknod_fifo_read_only() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_mknod_fifo_invalid_extra_operand() {
|
fn test_mknod_fifo_invalid_extra_operand() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg("test_file")
|
.arg("test_file")
|
||||||
|
@ -79,7 +72,6 @@ fn test_mknod_fifo_invalid_extra_operand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_mknod_character_device_requires_major_and_minor() {
|
fn test_mknod_character_device_requires_major_and_minor() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg("test_file")
|
.arg("test_file")
|
||||||
|
@ -109,7 +101,6 @@ fn test_mknod_character_device_requires_major_and_minor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_mknod_invalid_arg() {
|
fn test_mknod_invalid_arg() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg("--foo")
|
.arg("--foo")
|
||||||
|
@ -119,7 +110,6 @@ fn test_mknod_invalid_arg() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(windows))]
|
|
||||||
fn test_mknod_invalid_mode() {
|
fn test_mknod_invalid_mode() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg("--mode")
|
.arg("--mode")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue