Make close_fd_on_drop configurable (#132)

This commit is contained in:
BlackbirdBop 2024-07-18 20:01:11 +09:00 committed by GitHub
parent 15fe95a2c6
commit 635c7e557f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 2 deletions

View file

@ -33,6 +33,9 @@ pub fn mobile_run(args: Args, tun_mtu: u16, _packet_information: bool) -> c_int
#[cfg(unix)]
if let Some(fd) = args.tun_fd {
config.raw_fd(fd);
if let Some(v) = args.close_fd_on_drop {
config.close_fd_on_drop(v);
};
} else if let Some(ref tun) = args.tun {
config.tun_name(tun);
}