Separate LISTEN_FDS implementation into it's own crate

This commit is contained in:
Mathieu Trossevin 2024-01-11 17:41:12 +01:00
parent 099a22fb98
commit 613ae42bc1
Signed by: mtrossevin
GPG key ID: D1DBB7EA828374E9
5 changed files with 17 additions and 2 deletions

View file

@ -12,13 +12,14 @@ rust-version = "1.74.0"
[features]
default = []
listenfd = ["dep:rustix", "rustix/fs", "dep:libc"]
listenfd = ["dep:storefd-listen"]
notify = ["dep:libc", "dep:rustix", "rustix/pipe", "rustix/event"]
[dependencies]
libc = { version = "0.2.150", optional = true }
log = "0.4.20"
rustix = { version = "0.38.26", optional = true, features = ["net"] }
storefd-listen = { path = "./storefd-listen", version = "0.1.0", optional = true }
[package.metadata.docs.rs]
features = ["listenfd", "notify"]

View file

@ -4,7 +4,7 @@
#[cfg(feature = "listenfd")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "listenfd")))]
pub mod listen;
pub use storefd_listen;
#[cfg(feature = "notify")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "notify")))]
pub mod notify;

14
storefd-listen/Cargo.toml Normal file
View file

@ -0,0 +1,14 @@
[package]
name = "storefd-listen"
version = "0.1.0"
edition = "2021"
license = "MIT"
authors = ["Mathieu Trossevin <mtrossevin@evolix.fr>"]
description = "An implementation of file descriptor passing with `LISTEN_FD`."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rustix = { version = "0.38.26", features = ["net", "fs"] }
libc = "0.2.150"
log = "0.4.20"