Skip to content

Commit a423041

Browse files
authored
Merge pull request #7821 from cakebaker/mknod_remove_windows_code_flags
mknod: remove windows-related code & flags
2 parents 1986c96 + 9e7f3ac commit a423041

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/uu/mknod/src/mknod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,13 @@ fn makedev(maj: u64, min: u64) -> dev_t {
2626
((min & 0xff) | ((maj & 0xfff) << 8) | ((min & !0xff) << 12) | ((maj & !0xfff) << 32)) as dev_t
2727
}
2828

29-
#[cfg(windows)]
30-
fn _mknod(file_name: &str, mode: mode_t, dev: dev_t) -> i32 {
31-
panic!("Unsupported for windows platform")
32-
}
33-
3429
#[derive(Clone, PartialEq)]
3530
enum FileType {
3631
Block,
3732
Character,
3833
Fifo,
3934
}
4035

41-
#[cfg(unix)]
4236
fn _mknod(file_name: &str, mode: mode_t, dev: dev_t) -> i32 {
4337
let c_str = CString::new(file_name).expect("Failed to convert to CString");
4438

tests/by-util/test_mknod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ use uutests::util::TestScenario;
77
use uutests::util_name;
88

99
#[test]
10-
#[cfg(not(windows))]
1110
fn test_invalid_arg() {
1211
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);
1312
}
1413

15-
#[cfg(not(windows))]
1614
#[test]
1715
fn test_mknod_help() {
1816
new_ucmd!()
@@ -23,7 +21,6 @@ fn test_mknod_help() {
2321
}
2422

2523
#[test]
26-
#[cfg(not(windows))]
2724
fn test_mknod_version() {
2825
assert!(
2926
new_ucmd!()
@@ -36,7 +33,6 @@ fn test_mknod_version() {
3633
}
3734

3835
#[test]
39-
#[cfg(not(windows))]
4036
fn test_mknod_fifo_default_writable() {
4137
let ts = TestScenario::new(util_name!());
4238
ts.ucmd().arg("test_file").arg("p").succeeds();
@@ -45,15 +41,13 @@ fn test_mknod_fifo_default_writable() {
4541
}
4642

4743
#[test]
48-
#[cfg(not(windows))]
4944
fn test_mknod_fifo_mnemonic_usage() {
5045
let ts = TestScenario::new(util_name!());
5146
ts.ucmd().arg("test_file").arg("pipe").succeeds();
5247
assert!(ts.fixtures.is_fifo("test_file"));
5348
}
5449

5550
#[test]
56-
#[cfg(not(windows))]
5751
fn test_mknod_fifo_read_only() {
5852
let ts = TestScenario::new(util_name!());
5953
ts.ucmd()
@@ -67,7 +61,6 @@ fn test_mknod_fifo_read_only() {
6761
}
6862

6963
#[test]
70-
#[cfg(not(windows))]
7164
fn test_mknod_fifo_invalid_extra_operand() {
7265
new_ucmd!()
7366
.arg("test_file")
@@ -79,7 +72,6 @@ fn test_mknod_fifo_invalid_extra_operand() {
7972
}
8073

8174
#[test]
82-
#[cfg(not(windows))]
8375
fn test_mknod_character_device_requires_major_and_minor() {
8476
new_ucmd!()
8577
.arg("test_file")
@@ -109,7 +101,6 @@ fn test_mknod_character_device_requires_major_and_minor() {
109101
}
110102

111103
#[test]
112-
#[cfg(not(windows))]
113104
fn test_mknod_invalid_arg() {
114105
new_ucmd!()
115106
.arg("--foo")
@@ -119,7 +110,6 @@ fn test_mknod_invalid_arg() {
119110
}
120111

121112
#[test]
122-
#[cfg(not(windows))]
123113
fn test_mknod_invalid_mode() {
124114
new_ucmd!()
125115
.arg("--mode")

0 commit comments

Comments
 (0)