From ce8d56189d54713e4b9de274b2969e5180d293ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Thu, 18 Aug 2022 03:48:55 +0200 Subject: [PATCH] Implement for Solaris Untested, because `x86_64-sun-solaris` is an alias for `x86_64-unknown-illumos` by now, and there is no docker image for `x86_64-pc-solaris`. --- .github/workflows/rust.yml | 1 + Cargo.toml | 2 +- src/lib.rs | 5 ++++- src/platform.rs | 2 +- src/tz_illumos.rs | 2 ++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9b6c49e..387745f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -87,6 +87,7 @@ jobs: - i686-linux-android - arm-linux-androideabi - aarch64-linux-android + - sparcv9-sun-solaris runs-on: ubuntu-latest name: "Build for ${{ matrix.target }}" steps: diff --git a/Cargo.toml b/Cargo.toml index 12e40be..78631d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "iana-time-zone" description = "get the IANA time zone for the current system" -version = "0.1.45" +version = "0.1.46" authors = ["Andrew Straw "] repository = "https://github.com/strawlab/iana-time-zone" license = "MIT OR Apache-2.0" diff --git a/src/lib.rs b/src/lib.rs index b4af806..2d58b55 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,7 +33,10 @@ any(target_os = "netbsd", target_os = "openbsd"), path = "tz_netbsd.rs" )] -#[cfg_attr(target_os = "illumos", path = "tz_illumos.rs")] +#[cfg_attr( + any(target_os = "illumos", target_os = "solaris"), + path = "tz_illumos.rs" +)] #[cfg_attr(target_os = "android", path = "tz_android.rs")] mod platform; diff --git a/src/platform.rs b/src/platform.rs index 814d977..82b7f17 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -5,5 +5,5 @@ pub fn get_timezone_inner() -> std::result::Result Result { // https://illumos.org/man/5/TIMEZONE + // https://docs.oracle.com/cd/E23824_01/html/821-1473/uc-timezone-4.html + let file = OpenOptions::new().read(true).open("/etc/default/init")?; let mut reader = BufReader::with_capacity(1536, file); let mut line = String::with_capacity(80);