mirror of
https://github.com/ostreedev/ostree.git
synced 2025-02-25 21:57:42 +03:00
sysroot: Add a method to borrow sysroot fd
For the same reason we have this method on `Repo`.
This commit is contained in:
parent
b0be23365b
commit
d3190dbf56
@ -1,5 +1,7 @@
|
|||||||
use crate::gio;
|
use crate::gio;
|
||||||
use crate::Sysroot;
|
use crate::Sysroot;
|
||||||
|
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||||
|
use std::os::fd::BorrowedFd;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
@ -62,6 +64,14 @@ impl SysrootBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Sysroot {
|
||||||
|
/// Borrow the directory file descriptor for this sysroot.
|
||||||
|
#[cfg(feature = "v2017_10")]
|
||||||
|
pub fn dfd_borrow(&self) -> BorrowedFd {
|
||||||
|
unsafe { BorrowedFd::borrow_raw(self.fd()) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user