Skip to content

Commit 487ee79

Browse files
committed
Rollup merge of #22846 - dhuseby:bitrig-cleanup, r=alexcrichton
This patch contains a couple time fixes to make Rust compile on Bitrig again. This does not affect OpenBSD.
2 parents d9704bd + 804c071 commit 487ee79

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

src/libstd/sys/unix/fs.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -291,29 +291,14 @@ fn mkstat(stat: &libc::stat) -> FileStat {
291291
// FileStat times are in milliseconds
292292
fn mktime(secs: u64, nsecs: u64) -> u64 { secs * 1000 + nsecs / 1000000 }
293293

294-
#[cfg(target_os = "bitrig")]
295-
fn ctime(stat: &libc::stat) -> u64 {
296-
mktime(stat.st_ctim.tv_sec as u64, stat.st_ctim.tv_nsec as u64)
297-
}
298-
#[cfg(not(target_os = "bitrig"))]
299294
fn ctime(stat: &libc::stat) -> u64 {
300295
mktime(stat.st_ctime as u64, stat.st_ctime_nsec as u64)
301296
}
302297

303-
#[cfg(target_os = "bitrig")]
304-
fn atime(stat: &libc::stat) -> u64 {
305-
mktime(stat.st_atim.tv_sec as u64, stat.st_atim.tv_nsec as u64)
306-
}
307-
#[cfg(not(target_os = "bitrig"))]
308298
fn atime(stat: &libc::stat) -> u64 {
309299
mktime(stat.st_atime as u64, stat.st_atime_nsec as u64)
310300
}
311301

312-
#[cfg(target_os = "bitrig")]
313-
fn mtime(stat: &libc::stat) -> u64 {
314-
mktime(stat.st_mtim.tv_sec as u64, stat.st_mtim.tv_nsec as u64)
315-
}
316-
#[cfg(not(target_os = "bitrig"))]
317302
fn mtime(stat: &libc::stat) -> u64 {
318303
mktime(stat.st_mtime as u64, stat.st_mtime_nsec as u64)
319304
}

src/libstd/sys/unix/process2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ fn translate_status(status: c_int) -> ExitStatus {
439439
target_os = "ios",
440440
target_os = "freebsd",
441441
target_os = "dragonfly",
442+
target_os = "bitrig",
442443
target_os = "openbsd"))]
443444
mod imp {
444445
pub fn WIFEXITED(status: i32) -> bool { (status & 0x7f) == 0 }

0 commit comments

Comments
 (0)