mirror of
https://gitee.com/openharmony/third_party_rust_nix
synced 2025-01-22 08:02:01 +00:00
7b7d954005
* Fix race conditions in the tests. Two tests were grabbing a mutex but immediately dropping it. Thank you, Clippy. * Remove vestigial Windows support. Remove some code added to support Windows in 2015. Nix is no longer intended to ever run on Windows. * Various other minor Clippy lints.
13 lines
289 B
Rust
13 lines
289 B
Rust
use nix::net::if_::*;
|
|
|
|
#[cfg(any(target_os = "android", target_os = "linux"))]
|
|
const LOOPBACK: &[u8] = b"lo";
|
|
|
|
#[cfg(not(any(target_os = "android", target_os = "linux")))]
|
|
const LOOPBACK: &[u8] = b"lo0";
|
|
|
|
#[test]
|
|
fn test_if_nametoindex() {
|
|
assert!(if_nametoindex(LOOPBACK).is_ok());
|
|
}
|