We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd3f514 commit 529c594Copy full SHA for 529c594
src/process/mod.rs
@@ -1181,12 +1181,13 @@ impl Process {
1181
/// Calling this function is more efficient than calling `fd().unwrap().count()`
1182
pub fn fd_count(&self) -> ProcResult<usize> {
1183
// Use fast path if available (Linux v6.2): https://github.com/torvalds/linux/commit/f1f1f2569901
1184
- let stat = wrap_io_error!(
+ if let Ok(stat) = wrap_io_error!(
1185
self.root.join("fd"),
1186
rustix::fs::statat(&self.fd, "fd", AtFlags::SYMLINK_NOFOLLOW)
1187
- )?;
1188
- if stat.st_size > 0 {
1189
- return Ok(stat.st_size as usize);
+ ) {
+ if stat.st_size > 0 {
+ return Ok(stat.st_size as usize);
1190
+ }
1191
}
1192
1193
let fds = wrap_io_error!(
0 commit comments