containerd / ttrpc-rust

Rust implementation of ttrpc (GRPC for low-memory environments)
Apache License 2.0
195 stars 45 forks source link

Make the difference between cfg(target_os = "macos") and cfg(not(target_os = "linux")) clearer #122

Open liubin opened 2 years ago

liubin commented 2 years ago

There are two types of checking different OSs:

https://github.com/containerd/ttrpc-rust/blob/212d2211d3da7769a3b2bb5ee2f59db802cfb3a3/src/sync/server.rs#L335-L341

https://github.com/containerd/ttrpc-rust/blob/dfae1ad06ec29d93ed76dfcf3e931168cd1d426a/src/common.rs#L120-L123

Should these use the consistent way, for example, the pairs of:

mxpv commented 2 years ago

I think this partially intersects with https://github.com/containerd/ttrpc-rust/issues/132 SOCK_CLOEXEC fix applicable to both windows and mac os, so it make sense to use not(linux) or any(windows, macos).