diff options
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 38 | ||||
-rw-r--r-- | CHANGELOG.md | 15 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | Cargo.toml.orig | 4 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | TEST_MAPPING | 30 | ||||
-rw-r--r-- | cargo2android.json | 10 | ||||
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/sys/unix/selector/epoll.rs | 2 | ||||
-rw-r--r-- | src/sys/unix/selector/kqueue.rs | 2 | ||||
-rw-r--r-- | src/sys/unix/selector/mod.rs | 10 |
13 files changed, 102 insertions, 27 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index d513c37..a4887c5 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "772c692150c711d7bdd72b5c6287072b8914e519" + "sha1": "75f41fb304d299dfbc07679d15193e03273c4597" } } @@ -22,6 +22,8 @@ rust_library { name: "libmio", host_supported: true, crate_name: "mio", + cargo_env_compat: true, + cargo_pkg_version: "0.7.13", srcs: ["src/lib.rs"], edition: "2018", features: [ @@ -39,12 +41,40 @@ rust_library { ], apex_available: [ "//apex_available:platform", + "com.android.bluetooth", "com.android.resolv", + "com.android.uwb", ], + vendor_available: true, min_sdk_version: "29", } -// dependent_library ["feature_list"] -// cfg-if-1.0.0 -// libc-0.2.94 "default,std" -// log-0.4.14 "std" +rust_test { + name: "mio_test_src_lib", + host_supported: true, + crate_name: "mio", + cargo_env_compat: true, + cargo_pkg_version: "0.7.13", + srcs: ["src/lib.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, + test_options: { + unit_test: true, + }, + edition: "2018", + features: [ + "net", + "os-ext", + "os-poll", + "os-util", + "tcp", + "udp", + "uds", + ], + rustlibs: [ + "libenv_logger", + "liblibc", + "liblog_rust", + "librand", + ], +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 72cb770..4e12fc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# 0.7.13 + +## Fixes + +* Fix `Registry::try_clone` invalid usage of `F_DUPFD_CLOEXEC` (#1497, + https://github.com/tokio-rs/mio/commit/2883f5c1f35bf1a59682c5ffc4afe6b97d7d6e68). + +# 0.7.12 (yanked) + +## Fixes + +* Set `FD_CLOEXEC` when calling `Registry::try_clone` + (https://github.com/tokio-rs/mio/commit/d1617b567ff6bc669d71e367d22e0e93ff7e2e24 for epoll and + (https://github.com/tokio-rs/mio/commit/b367a05e408ca90a26383c3aa16d8a16f019dc59 for kqueue). + # 0.7.11 ## Fixes @@ -40,7 +40,7 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.11" +version = "0.7.13" dependencies = [ "env_logger", "libc", @@ -13,12 +13,12 @@ [package] edition = "2018" name = "mio" -version = "0.7.11" +version = "0.7.13" authors = ["Carl Lerche <me@carllerche.com>", "Thomas de Zeeuw <thomasdezeeuw@gmail.com>", "Tokio Contributors <team@tokio.rs>"] include = ["Cargo.toml", "LICENSE", "README.md", "CHANGELOG.md", "src/**/*.rs", "examples/**/*.rs"] description = "Lightweight non-blocking IO" homepage = "https://github.com/tokio-rs/mio" -documentation = "https://docs.rs/mio/0.7.7" +documentation = "https://docs.rs/mio/0.7.13" readme = "README.md" keywords = ["io", "async", "non-blocking"] categories = ["asynchronous"] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index a14d17d..aa2e677 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -6,7 +6,7 @@ name = "mio" # - Update CHANGELOG.md. # - Update doc URL. # - Create git tag -version = "0.7.11" +version = "0.7.13" license = "MIT" authors = [ "Carl Lerche <me@carllerche.com>", @@ -14,7 +14,7 @@ authors = [ "Tokio Contributors <team@tokio.rs>", ] description = "Lightweight non-blocking IO" -documentation = "https://docs.rs/mio/0.7.7" +documentation = "https://docs.rs/mio/0.7.13" homepage = "https://github.com/tokio-rs/mio" repository = "https://github.com/tokio-rs/mio" readme = "README.md" @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/mio/mio-0.7.11.crate" + value: "https://static.crates.io/crates/mio/mio-0.7.13.crate" } - version: "0.7.11" + version: "0.7.13" license_type: NOTICE last_upgrade_date { year: 2021 - month: 4 - day: 1 + month: 6 + day: 21 } } diff --git a/TEST_MAPPING b/TEST_MAPPING index fadb544..88a3a20 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,23 +1,39 @@ // Generated by update_crate_tests.py for tests that depend on this crate. { - "presubmit": [ + "imports": [ + { + "path": "external/rust/crates/futures-util" + }, + { + "path": "external/rust/crates/quiche" + }, { - "name": "tokio-test_device_test_tests_macros" + "path": "external/rust/crates/tokio" }, { - "name": "tokio-test_device_test_tests_block_on" + "path": "external/rust/crates/tokio-test" + } + ], + "presubmit": [ + { + "name": "doh_unit_test" }, { - "name": "tokio-test_device_test_tests_io" + "name": "mio_test_src_lib" }, { - "name": "futures-util_device_test_src_lib" + "name": "rustBinderTest" + } + ], + "presubmit-rust": [ + { + "name": "doh_unit_test" }, { - "name": "tokio-test_device_test_src_lib" + "name": "mio_test_src_lib" }, { - "name": "quiche_device_test_src_lib" + "name": "rustBinderTest" } ] } diff --git a/cargo2android.json b/cargo2android.json index 86c4a39..7b3f179 100644 --- a/cargo2android.json +++ b/cargo2android.json @@ -1,11 +1,15 @@ { "apex-available": [ "//apex_available:platform", - "com.android.resolv" + "com.android.bluetooth", + "com.android.resolv", + "com.android.uwb" ], "dependencies": true, "device": true, "features": "os-poll,tcp,udp,uds,os-util", "min-sdk-version": "29", - "run": true -}
\ No newline at end of file + "run": true, + "vendor-available": true, + "tests": true +} @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/mio/0.7.11")] +#![doc(html_root_url = "https://docs.rs/mio/0.7.13")] #![deny( missing_docs, missing_debug_implementations, diff --git a/src/sys/unix/selector/epoll.rs b/src/sys/unix/selector/epoll.rs index 76ee7f9..38667d6 100644 --- a/src/sys/unix/selector/epoll.rs +++ b/src/sys/unix/selector/epoll.rs @@ -41,7 +41,7 @@ impl Selector { } pub fn try_clone(&self) -> io::Result<Selector> { - syscall!(dup(self.ep)).map(|ep| Selector { + syscall!(fcntl(self.ep, libc::F_DUPFD_CLOEXEC, super::LOWEST_FD)).map(|ep| Selector { // It's the same selector, so we use the same id. #[cfg(debug_assertions)] id: self.id, diff --git a/src/sys/unix/selector/kqueue.rs b/src/sys/unix/selector/kqueue.rs index 34f5340..b36a537 100644 --- a/src/sys/unix/selector/kqueue.rs +++ b/src/sys/unix/selector/kqueue.rs @@ -87,7 +87,7 @@ impl Selector { } pub fn try_clone(&self) -> io::Result<Selector> { - syscall!(dup(self.kq)).map(|kq| Selector { + syscall!(fcntl(self.kq, libc::F_DUPFD_CLOEXEC, super::LOWEST_FD)).map(|kq| Selector { // It's the same selector, so we use the same id. #[cfg(debug_assertions)] id: self.id, diff --git a/src/sys/unix/selector/mod.rs b/src/sys/unix/selector/mod.rs index 7525898..b73d645 100644 --- a/src/sys/unix/selector/mod.rs +++ b/src/sys/unix/selector/mod.rs @@ -33,3 +33,13 @@ mod kqueue; target_os = "openbsd" ))] pub(crate) use self::kqueue::{event, Event, Events, Selector}; + +/// Lowest file descriptor used in `Selector::try_clone`. +/// +/// # Notes +/// +/// Usually fds 0, 1 and 2 are standard in, out and error. Some application +/// blindly assume this to be true, which means using any one of those a select +/// could result in some interesting and unexpected errors. Avoid that by using +/// an fd that doesn't have a pre-determined usage. +const LOWEST_FD: libc::c_int = 3; |