Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions vm/src/stdlib/pwd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ pub(crate) use pwd::make_module;
#[pymodule]
mod pwd {
use crate::{
PyObjectRef, PyResult, VirtualMachine,
PyResult, VirtualMachine,
builtins::{PyIntRef, PyUtf8StrRef},
convert::{IntoPyException, ToPyObject},
convert::IntoPyException,
exceptions,
types::PyStructSequence,
};
use nix::unistd::{self, User};
use std::ptr::NonNull;

#[cfg(not(target_os = "android"))]
use crate::{PyObjectRef, convert::ToPyObject};

#[pyattr]
#[pyclass(module = "pwd", name = "struct_passwd")]
Expand Down Expand Up @@ -101,7 +103,7 @@ mod pwd {
let mut list = Vec::new();

unsafe { libc::setpwent() };
while let Some(ptr) = NonNull::new(unsafe { libc::getpwent() }) {
while let Some(ptr) = std::ptr::NonNull::new(unsafe { libc::getpwent() }) {
let user = User::from(unsafe { ptr.as_ref() });
let passwd = Passwd::from(user).to_pyobject(vm);
list.push(passwd);
Expand Down
Loading