Skip to content

Commit d75f69f

Browse files
committed
Fix compilation on netbsd.
1 parent c908811 commit d75f69f

1 file changed

Lines changed: 6 additions & 28 deletions

File tree

cap-primitives/src/rustix/fs/metadata_ext.rs

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -110,28 +110,17 @@ impl ImplMetadataExt {
110110
#[cfg(target_os = "wasi")]
111111
permissions: ImplPermissionsExt::default(),
112112

113-
#[cfg(not(any(target_os = "netbsd", target_os = "wasi")))]
113+
#[cfg(not(target_os = "wasi"))]
114114
modified: system_time_from_rustix(
115115
stat.st_mtime.try_into().unwrap(),
116116
stat.st_mtime_nsec as _,
117117
),
118-
#[cfg(not(any(target_os = "netbsd", target_os = "wasi")))]
118+
#[cfg(not(target_os = "wasi"))]
119119
accessed: system_time_from_rustix(
120120
stat.st_atime.try_into().unwrap(),
121121
stat.st_atime_nsec as _,
122122
),
123123

124-
#[cfg(target_os = "netbsd")]
125-
modified: system_time_from_rustix(
126-
stat.st_mtime.try_into().unwrap(),
127-
stat.st_mtimensec as _,
128-
),
129-
#[cfg(target_os = "netbsd")]
130-
accessed: system_time_from_rustix(
131-
stat.st_atime.try_into().unwrap(),
132-
stat.st_atimensec as _,
133-
),
134-
135124
#[cfg(target_os = "wasi")]
136125
modified: system_time_from_rustix(stat.st_mtim.tv_sec, stat.st_mtim.tv_nsec as _),
137126
#[cfg(target_os = "wasi")]
@@ -140,6 +129,7 @@ impl ImplMetadataExt {
140129
#[cfg(any(
141130
target_os = "freebsd",
142131
target_os = "openbsd",
132+
target_os = "netbsd",
143133
target_os = "macos",
144134
target_os = "ios",
145135
target_os = "tvos",
@@ -151,12 +141,6 @@ impl ImplMetadataExt {
151141
stat.st_birthtime_nsec as _,
152142
),
153143

154-
#[cfg(target_os = "netbsd")]
155-
created: system_time_from_rustix(
156-
stat.st_birthtime.try_into().unwrap(),
157-
stat.st_birthtimensec as _,
158-
),
159-
160144
// `stat.st_ctime` is the latest status change; we want the creation.
161145
#[cfg(not(any(
162146
target_os = "freebsd",
@@ -198,22 +182,16 @@ impl ImplMetadataExt {
198182
size: u64::try_from(stat.st_size).unwrap(),
199183
#[cfg(not(target_os = "wasi"))]
200184
atime: i64::try_from(stat.st_atime).unwrap(),
201-
#[cfg(not(any(target_os = "netbsd", target_os = "wasi")))]
185+
#[cfg(not(target_os = "wasi"))]
202186
atime_nsec: stat.st_atime_nsec as _,
203-
#[cfg(target_os = "netbsd")]
204-
atime_nsec: stat.st_atimensec as _,
205187
#[cfg(not(target_os = "wasi"))]
206188
mtime: i64::try_from(stat.st_mtime).unwrap(),
207-
#[cfg(not(any(target_os = "netbsd", target_os = "wasi")))]
189+
#[cfg(not(target_os = "wasi"))]
208190
mtime_nsec: stat.st_mtime_nsec as _,
209-
#[cfg(target_os = "netbsd")]
210-
mtime_nsec: stat.st_mtimensec as _,
211191
#[cfg(not(target_os = "wasi"))]
212192
ctime: i64::try_from(stat.st_ctime).unwrap(),
213-
#[cfg(not(any(target_os = "netbsd", target_os = "wasi")))]
193+
#[cfg(not(target_os = "wasi"))]
214194
ctime_nsec: stat.st_ctime_nsec as _,
215-
#[cfg(target_os = "netbsd")]
216-
ctime_nsec: stat.st_ctimensec as _,
217195
#[cfg(not(target_os = "wasi"))]
218196
blksize: u64::try_from(stat.st_blksize).unwrap(),
219197
#[cfg(not(target_os = "wasi"))]

0 commit comments

Comments
 (0)