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
22 changes: 8 additions & 14 deletions src/pam/rpassword.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
drop(hide_input);
drop(handlers);

while let Some(signal) = signal::take_first_pending() {

Check warning on line 152 in src/pam/rpassword.rs

View workflow job for this annotation

GitHub Actions / build-and-test-msrv

unreachable expression

Check warning on line 152 in src/pam/rpassword.rs

View workflow job for this annotation

GitHub Actions / build-and-test-msrv

unreachable expression
match signal {
SIGTSTP | SIGTTIN | SIGTTOU => {
crate::system::kill(crate::system::Process::process_id(), signal)?;
Expand Down Expand Up @@ -339,20 +339,14 @@
None => -1,
};

if cfg!(miri) {
// Miri doesn't support poll: rust-lang/miri#4413
// FIXME(#1500) remove once miri supports it
pollfd[0].revents = libc::POLLIN;
} else {
// SAFETY: pollfd is initialized and its length matches
cerr(unsafe {
libc::poll(
pollfd.as_mut_ptr(),
pollfd.len().try_into().unwrap(),
timeout,
)
})?;
}
// SAFETY: pollfd is initialized and its length matches
cerr(unsafe {
libc::poll(
pollfd.as_mut_ptr(),
pollfd.len().try_into().unwrap(),
timeout,
)
})?;

// There may yet be data waiting to be read even if POLLHUP is set.
if pollfd[0].revents & (pollmask | libc::POLLHUP) > 0 {
Expand Down
Loading