Skip to content

Commit 50484ed

Browse files
committed
Fix struct utsname
1 parent 832e942 commit 50484ed

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/unix/bsd/mod.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,26 @@ s! {
8484
pub tm_zone: *mut ::c_char,
8585
}
8686

87-
#[cfg(not(target_os = "dragonfly"))]
8887
pub struct utsname {
88+
#[cfg(not(target_os = "dragonfly"))]
8989
pub sysname: [::c_char; 256],
90-
pub nodename: [::c_char; 256],
91-
pub release: [::c_char; 256],
92-
pub version: [::c_char; 256],
93-
pub machine: [::c_char; 256],
94-
}
95-
96-
#[cfg(target_os = "dragonfly")]
97-
pub struct utsname {
90+
#[cfg(target_os = "dragonfly")]
9891
pub sysname: [::c_char; 32],
92+
#[cfg(not(target_os = "dragonfly"))]
93+
pub nodename: [::c_char; 256],
94+
#[cfg(target_os = "dragonfly")]
9995
pub nodename: [::c_char; 32],
96+
#[cfg(not(target_os = "dragonfly"))]
97+
pub release: [::c_char; 256],
98+
#[cfg(target_os = "dragonfly")]
10099
pub release: [::c_char; 32],
100+
#[cfg(not(target_os = "dragonfly"))]
101+
pub version: [::c_char; 256],
102+
#[cfg(target_os = "dragonfly")]
101103
pub version: [::c_char; 32],
104+
#[cfg(not(target_os = "dragonfly"))]
105+
pub machine: [::c_char; 256],
106+
#[cfg(target_os = "dragonfly")]
102107
pub machine: [::c_char; 32],
103108
}
104109

0 commit comments

Comments
 (0)