Change pathconf/fpathconf wrapper to return c_long

This commit is contained in:
jam1garner
2021-09-17 13:48:32 -04:00
parent be3fd5d23c
commit 39d3e32a50

View File

@@ -1912,7 +1912,7 @@ mod _os {
path: PathOrFd,
ConfName(name): ConfName,
vm: &VirtualMachine,
) -> PyResult<Option<i64>> {
) -> PyResult<Option<libc::c_long>> {
use nix::errno::{self, Errno};
Errno::clear();
@@ -1932,13 +1932,13 @@ mod _os {
Err(io::Error::from(Errno::last()).into_pyexception(vm))
}
} else {
Ok(Some(raw as i64))
Ok(Some(raw))
}
}
#[cfg(unix)]
#[pyfunction]
fn fpathconf(fd: i32, name: ConfName, vm: &VirtualMachine) -> PyResult<Option<i64>> {
fn fpathconf(fd: i32, name: ConfName, vm: &VirtualMachine) -> PyResult<Option<libc::c_long>> {
pathconf(PathOrFd::Fd(fd), name, vm)
}