Skip to content

Commit 17b3f93

Browse files
authored
Unrolled build for #154706
Rollup merge of #154706 - hermit-os:time-hermit, r=Mark-Simulacrum fix compilation of time/hermit.rs #154518 has broken compiling std for Hermit by unwrapping an `i32`. This PR converts the `i32` to an `io::Result` before unwrapping. Closes #154626. Closes hermit-os/hermit-rs#965. r? @Mark-Simulacrum
2 parents e0e95a7 + 3d55f38 commit 17b3f93

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

library/std/src/sys/time/hermit.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
use hermit_abi::{self, CLOCK_MONOTONIC, CLOCK_REALTIME};
22

33
use crate::io;
4+
use crate::sys::cvt;
45
use crate::sys::pal::time::Timespec;
56
use crate::time::Duration;
67

78
fn clock_gettime(clock: hermit_abi::clockid_t) -> Timespec {
89
let mut t = hermit_abi::timespec { tv_sec: 0, tv_nsec: 0 };
9-
unsafe { hermit_abi::clock_gettime(clock, &raw mut t) }.unwrap();
10+
cvt(unsafe { hermit_abi::clock_gettime(clock, &raw mut t) }).unwrap();
1011
Timespec::new(t.tv_sec, t.tv_nsec.into()).unwrap()
1112
}
1213

0 commit comments

Comments
 (0)