From 6e28505172ef1f749061046210a2ae7c7ce80df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Thu, 18 Aug 2022 03:50:04 +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 + CHANGELOG.md | 4 ++++ Cargo.toml | 2 +- src/lib.rs | 5 ++++- src/platform.rs | 2 +- src/tz_illumos.rs | 2 ++ 6 files changed, 13 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/CHANGELOG.md b/CHANGELOG.md index a8cf1dc..76ba757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.46] - 2022-08-18 +### Added +- Implement for Solaris ([#55](https://github.com/strawlab/iana-time-zone/pull/55)) + ## [0.1.45] - 2022-08-16 ### Fixed - Fix potential use after free in MacOS / iOS ([#54](https://github.com/strawlab/iana-time-zone/pull/54), [RUSTSEC-2022-0049](https://rustsec.org/advisories/RUSTSEC-2022-0049.html)) 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);