Skip to content

Commit 2f3c85f

Browse files
[#420] fix freebsd compilation time error (#421)
* [#420] fix freebsd compilation time error * fix: rustfmt --------- Co-authored-by: Celeste Sinéad <[email protected]>
1 parent e53d81d commit 2f3c85f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

boringtun/src/sleepyinstant/unix.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@ use std::time::Duration;
33
use nix::sys::time::TimeSpec;
44
use nix::time::{clock_gettime, ClockId};
55

6-
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
6+
#[cfg(any(
7+
target_os = "macos",
8+
target_os = "ios",
9+
target_os = "tvos",
10+
target_os = "freebsd"
11+
))]
712
const CLOCK_ID: ClockId = ClockId::CLOCK_MONOTONIC;
8-
#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "tvos")))]
13+
#[cfg(not(any(
14+
target_os = "macos",
15+
target_os = "ios",
16+
target_os = "tvos",
17+
target_os = "freebsd"
18+
)))]
919
const CLOCK_ID: ClockId = ClockId::CLOCK_BOOTTIME;
1020

1121
#[derive(Clone, Copy, Debug)]

0 commit comments

Comments
 (0)